Browse Source

test

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

12
iguana/iguana_bundles.c

@ -557,7 +557,7 @@ int32_t iguana_bundleissue(struct iguana_info *coin,struct iguana_bundle *bp,int
block->numrequests++;
if ( bp == coin->current )
printf("[%d:%d] ",bp->hdrsi,i);
iguana_blockQ("kick",coin,bp,i,block->RO.hash2,0);
iguana_blockQ("kick",coin,bp,i,block->RO.hash2,bp == coin->current);
bp->issued[i] = block->issued = now;
counter++;
if ( --max <= 0 )
@ -854,8 +854,8 @@ void iguana_bundlestats(struct iguana_info *coin,char *str)
// printf("UNEXPECTED null block for bundlehash.%d\n",bp->hdrsi);
if ( bp->numhashes < bp->n && bp->speculative != 0 )
{
for (j=1; j<bp->numspec&&j<bp->n; j++)
iguana_blockhashset(coin,-1,bp->speculative[j],1);
//for (j=1; j<bp->numspec&&j<bp->n; j++)
// iguana_blockhashset(coin,-1,bp->speculative[j],1);
//char str[65],str2[65];
for (j=1; j<bp->numspec&&j<bp->n; j++)
{
@ -864,7 +864,10 @@ void iguana_bundlestats(struct iguana_info *coin,char *str)
if ( bits256_nonz(bp->hashes[j]) != 0 )
block = iguana_blockfind(coin,bp->hashes[j]);
else if ( bits256_nonz(bp->speculative[j]) != 0 )
block = iguana_blockfind(coin,bp->speculative[j]);
{
if ( (block= iguana_blockfind(coin,bp->speculative[j])) == 0 )
block = iguana_blockhashset(coin,-1,bp->speculative[j],1);
}
}
else if ( bits256_nonz(block->RO.prev_block) != 0 && block->fpipbits != 0 )
continue;
@ -885,6 +888,7 @@ void iguana_bundlestats(struct iguana_info *coin,char *str)
else if ( now > block->issued+10 )
{
block->issued = now;
printf("submit speculative [%d:%d]\n",bp->hdrsi,j);
iguana_blockQ("spec",coin,0,-1,block->RO.hash2,0);
}
}

4
iguana/iguana_recv.c

@ -958,7 +958,7 @@ int32_t iguana_reqblocks(struct iguana_info *coin)
else if ( bp != 0 && time(NULL) > bp->hdrtime+10 )
{
char str[65];
printf("MAINCHAIN gethdr %d\n",bp->bundleheight);
printf("MAINCHAIN gethdr %d %s\n",bp->bundleheight,bits256_str(str,bp->hashes[0]));
queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0])),1);
bp->hdrtime = (uint32_t)time(NULL);
}
@ -1161,7 +1161,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr)
}
if ( bp == 0 || z != 0 )
{
//printf("%s request HDR.(%s) numhashes.%d\n",addr!=0?addr->ipaddr:"local",hashstr,bp!=0?bp->numhashes:0);
printf("%s request HDR.(%s) numhashes.%d\n",addr!=0?addr->ipaddr:"local",hashstr,bp!=0?bp->numhashes:0);
iguana_send(coin,addr,serialized,datalen);
addr->pendhdrs++;
flag++;

Loading…
Cancel
Save