Browse Source

test

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

2
iguana/iguana_bundles.c

@ -875,7 +875,7 @@ void iguana_bundlestats(struct iguana_info *coin,char *str)
continue;
prev = bp->blocks[j-1];
//printf("[%d:%d] prev.%p nonz.%d speculative.%d block.%p\n",bp->hdrsi,j,bp->blocks[j-1],bits256_nonz(bp->hashes[j]),bits256_nonz(bp->speculative[j]),bp->blocks[j]);
if ( block != 0 && prev != 0 && bp->blocks[j] == 0 )
if ( block != 0 && bp->blocks[j] == 0 ) //prev != 0 &&
{
//char str2[65]; printf("[%d:%d] prev.%p nonz.%d speculative.%d prev.%s vs %s ipbits.%x q.%d\n",bp->hdrsi,j,bp->blocks[j-1],bits256_nonz(bp->hashes[j]),bits256_nonz(bp->speculative[j]),bits256_str(str,prev->RO.hash2),bits256_str(str2,block->RO.prev_block),block->fpipbits,block->queued);
if ( block->fpipbits == 0 && block->queued == 0 )

19
iguana/iguana_recv.c

@ -607,11 +607,11 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct
if ( bp != 0 && (bp->speculative == 0 || num > bp->numspec) && bp->emitfinish == 0 )
{
printf("FOUND speculative.%s BLOCKHASHES[%d] ht.%d\n",bits256_str(str,blockhashes[1]),num,bp->bundleheight);
if ( bp->speculative != 0 )
myfree(bp->speculative,sizeof(*bp->speculative) * bp->numspec);
bp->speculative = blockhashes;
bp->numspec = num;
req->hashes = 0;
if ( bp->speculative == 0 )
bp->speculative = mycalloc('s',bp->n+1,sizeof(*bp->speculative));
for (i=bp->numspec; i<num&&i<=bp->n; i++)
bp->speculative[i] = blockhashes[i];
bp->numspec = num <= bp->n+1 ? num : bp->n+1;
//iguana_blockQ(coin,0,-1,blockhashes[2],1);
}
}
@ -714,8 +714,13 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana
}
//printf("i.%d ref prev.(%s)\n",i,bits256_str(str,origblock->RO.prev_block));
}
else
else if ( bp == coin->current && bp != 0 && block != 0 && bundlei >= 0 )
{
if ( bp->speculative != 0 && bp->numspec <= bundlei )
{
bp->speculative[bundlei] = block->RO.hash2;
bp->numspec = bundlei+1;
}
}
if ( 1 )//&& bp != 0 && bp->hdrsi == coin->bundlescount-1 )
{
@ -744,7 +749,7 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana
prev = iguana_blockhashset(coin,-1,block->RO.prev_block,1);
if ( prev != 0 && (bits256_nonz(prev->RO.prev_block) == 0 || prev->fpipbits == 0) )
{
printf("auto prev newtx %s\n",bits256_str(str,prev->RO.prev_block));
printf("auto prev newtx %s\n",bits256_str(str,prev->RO.hash2));
prev->newtx = 1;
iguana_blockQ("autoprev",coin,0,-1,prev->RO.hash2,0);
}

Loading…
Cancel
Save