Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
a4e0eb193e
  1. 2
      iguana/iguana777.h
  2. 10
      iguana/iguana_bundles.c
  3. 2
      iguana/iguana_peers.c
  4. 12
      iguana/iguana_recv.c

2
iguana/iguana777.h

@ -461,7 +461,7 @@ struct iguana_info
uint64_t instance_nonce,myservices,totalsize,totalrecv,totalpackets,sleeptime; uint64_t instance_nonce,myservices,totalsize,totalrecv,totalpackets,sleeptime;
int64_t mining,totalfees,TMPallocated,MAXRECVCACHE,MAXMEM,estsize,activebundles; int64_t mining,totalfees,TMPallocated,MAXRECVCACHE,MAXMEM,estsize,activebundles;
int32_t MAXPEERS,MAXPENDING,MAXBUNDLES,active,closestbundle,numemitted,lastsweep,startutc,newramchain,numcached,cachefreed,helperdepth,startPEND,endPEND,enableCACHE,RELAYNODE,VALIDATENODE,balanceswritten,RTheight; bits256 balancehash; int32_t MAXPEERS,MAXPENDING,MAXBUNDLES,active,closestbundle,numemitted,lastsweep,startutc,newramchain,numcached,cachefreed,helperdepth,startPEND,endPEND,enableCACHE,RELAYNODE,VALIDATENODE,balanceswritten,RTheight; bits256 balancehash;
uint32_t lastsync,parsetime,numiAddrs,firstblock,lastpossible,bundlescount,savedblocks; uint32_t lastsync,parsetime,numiAddrs,firstblock,lastpossible,bundlescount,savedblocks,backlog;
int32_t longestchain,badlongestchain,longestchain_strange; int32_t longestchain,badlongestchain,longestchain_strange;
struct tai starttime; double startmillis; struct tai starttime; double startmillis;
struct iguana_chain *chain; struct iguana_chain *chain;

10
iguana/iguana_bundles.c

@ -541,7 +541,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
saved = block->issued; saved = block->issued;
if ( bp == coin->current ) if ( bp == coin->current )
forceflag = (now > block->issued + lag); forceflag = (now > block->issued + lag);
else forceflag = (now > block->issued + 3*lag); else forceflag = (now > block->issued + 10*lag);
if ( priority != 0 ) if ( priority != 0 )
{ {
//printf("[%d:%d] ",bp->hdrsi,i); //printf("[%d:%d] ",bp->hdrsi,i);
@ -561,8 +561,8 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
if ( flag != 0 && priority != 0 && laggard != 0 && coin->current == bp ) if ( flag != 0 && priority != 0 && laggard != 0 && coin->current == bp )
printf("[%d] reissued.%d currentflag.%d ht.%d s.%d finished.%d most.%d laggards.%d maxunfinished.%d\n",bp->hdrsi,flag,bp->currentflag,bp->bundleheight,bp->numsaved,finished,doneval,laggard,maxval); printf("[%d] reissued.%d currentflag.%d ht.%d s.%d finished.%d most.%d laggards.%d maxunfinished.%d\n",bp->hdrsi,flag,bp->currentflag,bp->bundleheight,bp->numsaved,finished,doneval,laggard,maxval);
} }
if ( bp == coin->current ) //if ( bp == coin->current )
return(counter); // return(counter);
} }
for (i=0; i<bp->n; i++) for (i=0; i<bp->n; i++)
{ {
@ -575,7 +575,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
block->numrequests++; block->numrequests++;
if ( bp == coin->current ) if ( bp == coin->current )
printf("[%d:%d].%x ",bp->hdrsi,i,block->fpipbits); printf("[%d:%d].%x ",bp->hdrsi,i,block->fpipbits);
iguana_blockQ("kickc",coin,bp,i,block->RO.hash2,bp == coin->current || now > block->issued+lag*3); iguana_blockQ("kickc",coin,bp,i,block->RO.hash2,bp == coin->current && now > block->issued+lag);
bp->issued[i] = block->issued = now; bp->issued[i] = block->issued = now;
counter++; counter++;
if ( --max <= 0 ) if ( --max <= 0 )
@ -587,7 +587,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
{ {
if ( bp == coin->current ) if ( bp == coin->current )
printf("[%d:%d].%x ",bp->hdrsi,i,block->fpipbits); printf("[%d:%d].%x ",bp->hdrsi,i,block->fpipbits);
iguana_blockQ("kickd",coin,bp,i,bp->hashes[i],bp == coin->current || now > bp->issued[i]+lag*3); iguana_blockQ("kickd",coin,bp,i,bp->hashes[i],bp == coin->current && now > bp->issued[i]+lag*3);
bp->issued[i] = now; bp->issued[i] = now;
counter++; counter++;
} }

2
iguana/iguana_peers.c

@ -1069,7 +1069,7 @@ void iguana_dedicatedloop(struct iguana_info *coin,struct iguana_peer *addr)
} }
else if ( addr->rank != 1 ) else if ( addr->rank != 1 )
usleep(coin->polltimeout*5000 + 1*(rand() % (coin->polltimeout*3000))); usleep(coin->polltimeout*5000 + 1*(rand() % (coin->polltimeout*3000)));
else usleep(10000); else usleep(10000 + coin->backlog);
} else run >>= 2; } else run >>= 2;
} }
if ( flag != 0 ) if ( flag != 0 )

12
iguana/iguana_recv.c

@ -1181,7 +1181,7 @@ struct iguana_blockreq { struct queueitem DL; bits256 hash2,*blockhashes; struct
int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle *bp,int32_t bundlei,bits256 hash2,int32_t priority) int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle *bp,int32_t bundlei,bits256 hash2,int32_t priority)
{ {
queue_t *Q; char *str; int32_t height = -1; struct iguana_blockreq *req; struct iguana_block *block = 0; queue_t *Q; char *str; int32_t n,height = -1; struct iguana_blockreq *req; struct iguana_block *block = 0;
if ( bits256_nonz(hash2) == 0 ) if ( bits256_nonz(hash2) == 0 )
{ {
printf("cant queue zerohash bundlei.%d\n",bundlei); printf("cant queue zerohash bundlei.%d\n",bundlei);
@ -1229,8 +1229,14 @@ int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle
req->height = height; req->height = height;
req->bundlei = bundlei; req->bundlei = bundlei;
char str2[65]; char str2[65];
if ( Q == &coin->blocksQ && queue_size(Q) > 100000 ) if ( Q == &coin->blocksQ )
printf("%s %s %s [%d:%d] %d %s %d numranked.%d qsize.%d\n",coin->symbol,argstr,str,bp!=0?bp->hdrsi:-1,bundlei,req->height,bits256_str(str2,hash2),coin->blocks.recvblocks,coin->peers.numranked,queue_size(Q)); {
if ( (n= queue_size(Q)) > 100000 )
{
printf("%s %s %s [%d:%d] %d %s %d numranked.%d qsize.%d\n",coin->symbol,argstr,str,bp!=0?bp->hdrsi:-1,bundlei,req->height,bits256_str(str2,hash2),coin->blocks.recvblocks,coin->peers.numranked,queue_size(Q));
coin->backlog = n;
} else coin->backlog >>= 1;
}
if ( block != 0 ) if ( block != 0 )
{ {
block->numrequests++; block->numrequests++;

Loading…
Cancel
Save