Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
8701105362
  1. 4
      iguana/iguana_bundles.c
  2. 2
      iguana/iguana_recv.c

4
iguana/iguana_bundles.c

@ -1220,14 +1220,14 @@ void iguana_bundlestats(struct iguana_info *coin,char *str,int32_t lag)
coin->stucktime = (uint32_t)time(NULL);
coin->stuckiters = 0;
}
else if ( coin->stucktime != 0 && (displag % 3) == 1 )
else if ( coin->stucktime != 0 )
{
uint8_t missings[IGUANA_MAXBUNDLESIZE/8+1]; struct iguana_blockreq *breq; double aveduration; int32_t tmp,tmp2,n,lag; //priority=3,
lag = (int32_t)time(NULL) - coin->stucktime;
bp = firstgap;
printf("NONZ stucktime.%u lag.%d iters.%d vs %d metric.%d\n",coin->stucktime,lag,coin->stuckiters,lag/coin->MAXSTUCKTIME,(firstgap->hdrsi * coin->chain->bundlesize * 10) + firstgap->numsaved + firstgap->numhashes + firstgap->numcached);
if ( (lag/coin->MAXSTUCKTIME) > coin->stuckiters )
{
printf("NONZ stucktime.%u lag.%d iters.%d vs %d metric.%d\n",coin->stucktime,lag,coin->stuckiters,lag/coin->MAXSTUCKTIME,(firstgap->hdrsi * coin->chain->bundlesize * 10) + firstgap->numsaved + firstgap->numhashes + firstgap->numcached);
//printf("UNSTICK\n");
iguana_unstickhdr(coin,bp,6);
coin->stuckiters = (int32_t)(lag/coin->MAXSTUCKTIME);

2
iguana/iguana_recv.c

@ -314,7 +314,7 @@ void iguana_gotblockM(struct iguana_info *coin,struct iguana_peer *addr,struct i
static uint64_t received[IGUANA_MAXPEERS],count[IGUANA_MAXPEERS];
received[addr->addrind] += recvlen;
count[addr->addrind]++;
if ( (rand() % 10000) == 0 )
if ( (rand() % 1000) == 0 )
{
uint64_t sum2 = 0,sum = 0;
for (i=0; i<sizeof(received)/sizeof(*received); i++)

Loading…
Cancel
Save