From 8c58a74761a8832f3267848ce10e039803646882 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 16 Aug 2016 12:03:13 -0300 Subject: [PATCH] test --- iguana/iguana_blocks.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iguana/iguana_blocks.c b/iguana/iguana_blocks.c index 893b7ddb6..d6c239571 100755 --- a/iguana/iguana_blocks.c +++ b/iguana/iguana_blocks.c @@ -543,7 +543,11 @@ struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_bl block->mainchain = block->valid = block->txvalid = 0; iguana_blocksizecheck("chainlink",coin->chain->zcash,block); if ( memcmp(coin->chain->genesis_hashdata,block->RO.hash2.bytes,sizeof(bits256)) == 0 ) + { block->PoW = PoW_from_compact(block->RO.bits,coin->chain->unitval), height = 0; + if ( isnan(block->PoW) != 0 ) + block->PoW = 0.; + } else if ( (prev= iguana_blockfind("chainprev",coin,block->RO.prev_block)) != 0 ) { if ( memcmp(prev->RO.hash2.bytes,coin->blocks.hwmchain.RO.hash2.bytes,sizeof(bits256)) == 0 ) @@ -577,7 +581,7 @@ struct iguana_block *_iguana_chainlink(struct iguana_info *coin,struct iguana_bl //getchar(); return(0); } - char str[65]; printf("extend? %s.h%d: %.15f vs %.15f ht.%d vs %d\n",bits256_str(str,block->RO.hash2),height,block->PoW,coin->blocks.hwmchain.PoW,height,coin->blocks.hwmchain.height); + //char str[65]; printf("extend? %s.h%d: %.15f vs %.15f ht.%d vs %d\n",bits256_str(str,block->RO.hash2),height,block->PoW,coin->blocks.hwmchain.PoW,height,coin->blocks.hwmchain.height); if ( iguana_blockvalidate(coin,&valid,newblock,0) < 0 || valid == 0 ) return(0); block->height = height;