Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
6396fd94f6
  1. 2
      iguana/iguana777.h
  2. 6
      iguana/iguana_bundles.c

2
iguana/iguana777.h

@ -418,7 +418,7 @@ struct iguana_bundle
{
struct queueitem DL; struct iguana_info *coin; struct iguana_bundle *nextbp;
struct iguana_bloom16 bloom; uint32_t rawscriptspace;
uint32_t issuetime,hdrtime,emitfinish,mergefinish,purgetime,queued,startutxo,utxofinish,balancefinish,validated,lastspeculative,dirty,nexttime;
uint32_t issuetime,hdrtime,emitfinish,mergefinish,purgetime,queued,startutxo,utxofinish,balancefinish,validated,lastspeculative,dirty,nexttime,currenttime;
int32_t numhashes,numrecv,numsaved,numcached,rank,generrs,checkedtmp,currentflag;
int32_t minrequests,n,hdrsi,bundleheight,numtxids,numspends,numunspents,numspec;
double avetime,threshold,metric; uint64_t datasize,estsize;

6
iguana/iguana_bundles.c

@ -376,6 +376,8 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
memset(donecounts,0,sizeof(donecounts));
if ( (numpeers= coin->peers.numranked) > 8 )//&& bp->currentflag < bp->n )
{
if ( bp->currentflag == 0 )
bp->currenttime = now;
if ( bp->numhashes >= bp->n )
{
for (j=0; j<numpeers; j++)
@ -444,7 +446,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
{
for (i=laggard=finished=0; i<numpeers; i++)
{
if ( peercounts[i] > 10*donecounts[i] )
if ( peercounts[i] > (bp->n/numpeers)-2 )
laggard++;
if ( peercounts[i] == 0 && donecounts[i] > 2 )
finished++;
@ -454,7 +456,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
printf("90%% finished %d, laggards.%d\n",finished,laggard);
for (i=laggard=finished=0; i<numpeers; i++)
{
if ( peercounts[i] > 10*donecounts[i] && (addr= coin->peers.ranked[i]) != 0 )
if ( peercounts[i] > 10*donecounts[i] && (addr= coin->peers.ranked[i]) != 0 && now > bp->currenttime+30 )
{
printf("kill peer.%d %s\n",i,addr->ipaddr);
addr->dead = (uint32_t)time(NULL);

Loading…
Cancel
Save