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;
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;
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;
struct tai starttime; double startmillis;
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;
if ( bp == coin->current )
forceflag = (now > block->issued + lag);
else forceflag = (now > block->issued + 3*lag);
else forceflag = (now > block->issued + 10*lag);
if ( priority != 0 )
{
//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 )
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 )
return(counter);
//if ( bp == coin->current )
// return(counter);
}
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++;
if ( bp == coin->current )
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;
counter++;
if ( --max <= 0 )
@ -587,7 +587,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
{
if ( bp == coin->current )
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;
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 )
usleep(coin->polltimeout*5000 + 1*(rand() % (coin->polltimeout*3000)));
else usleep(10000);
else usleep(10000 + coin->backlog);
} else run >>= 2;
}
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)
{
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 )
{
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->bundlei = bundlei;
char str2[65];
if ( Q == &coin->blocksQ && 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));
if ( Q == &coin->blocksQ )
{
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 )
{
block->numrequests++;

Loading…
Cancel
Save