Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
7c10f153b7
  1. 14
      iguana/iguana_blocks.c
  2. 2
      iguana/iguana_recv.c
  3. 4
      iguana/iguana_unspents.c

14
iguana/iguana_blocks.c

@ -297,20 +297,20 @@ int32_t iguana_walkchain(struct iguana_info *coin)
{
char str[65]; int32_t height,hdrsi,bundlei,n = 0; struct iguana_bundle *bp; struct iguana_block *block;
height = coin->blocks.hwmchain.height;
while ( (block= iguana_blockfind("main",coin,iguana_blockhash(coin,height))) != 0 )
while ( 1 ) //(block= iguana_blockfind("main",coin,iguana_blockhash(coin,height))) != 0 )
{
hdrsi = (height / coin->chain->bundlesize);
bundlei = (height % coin->chain->bundlesize);
if ( block->height >= 0 && block->height != height )
printf("walkchain height mismatch %d vs %d\n",block->height,height);
if ( bits256_cmp(iguana_blockhash(coin,height),block->RO.hash2) != 0 )
if ( (bp= coin->bundles[hdrsi]) == 0 || (block= bp->blocks[bundlei]) == 0 )
{
printf("walk error blockhash error at %d %s\n",height,bits256_str(str,block->RO.hash2));
printf("walk error [%d:%d] %p vs %p\n",hdrsi,bundlei,block,bp->blocks[bundlei]);
break;
}
else if ( (bp= coin->bundles[hdrsi]) == 0 || block != bp->blocks[bundlei] )
else if ( block->height >= 0 && block->height != height )
printf("walkchain height mismatch %d vs %d\n",block->height,height);
if ( bits256_cmp(iguana_blockhash(coin,height),block->RO.hash2) != 0 )
{
printf("walk error [%d:%d] %p vs %p\n",hdrsi,bundlei,block,bp->blocks[bundlei]);
printf("walk error blockhash error at %d %s\n",height,bits256_str(str,block->RO.hash2));
break;
}
else if ( bits256_cmp(bp->hashes[bundlei],block->RO.hash2) != 0 )

2
iguana/iguana_recv.c

@ -1157,7 +1157,7 @@ int32_t iguana_reqblocks(struct iguana_info *coin)
iguana_blockQ("mainchain",coin,0,-1,hash2,1);//lag > threshold);
flag++;
char str[65];
if ( 1 && (rand() % 10000) == 0 )//|| bp->bundleheight > coin->longestchain-coin->chain->bundlesize )
if ( 1 && (rand() % 100000) == 0 )//|| bp->bundleheight > coin->longestchain-coin->chain->bundlesize )
printf("%s %s MAIN.%d t %.3f lag %.3f\n",coin->symbol,bits256_str(str,hash2),coin->blocks.hwmchain.height+1,threshold,lag);
}
if ( 0 && bp != 0 && bundlei < bp->n-1 && (bits256_nonz(bp->hashes[bundlei+1]) != 0 || (bp->speculative != 0 && bits256_nonz(bp->speculative[bundlei+1]) != 0)) )

4
iguana/iguana_unspents.c

@ -1851,8 +1851,8 @@ int32_t iguana_realtime_update(struct iguana_info *coin)
{
for (i=bundlei; i<bp->n; i++)
{
block = iguana_bundleblock(coin,&hash2,bp,bundlei+i);
if ( i == 0 || (bits256_nonz(hash2) != 0 && (block == 0 || block->txvalid == 0)) )
block = iguana_bundleblock(coin,&hash2,bp,i);
if ( bits256_nonz(hash2) != 0 && (block == 0 || block->txvalid == 0) )
{
uint8_t serialized[512]; int32_t len; struct iguana_peer *addr;
char str[65]; printf("RT error [%d:%d] %s %p\n",bp->hdrsi,i,bits256_str(str,hash2),block);

Loading…
Cancel
Save