From ce41f1e541b26fe1f08854071cb58c24205c7953 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 5 Jun 2016 01:11:22 -0300 Subject: [PATCH] test --- iguana/iguana_blocks.c | 7 ++++--- iguana/iguana_realtime.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iguana/iguana_blocks.c b/iguana/iguana_blocks.c index 184066ed3..3bcc536c6 100755 --- a/iguana/iguana_blocks.c +++ b/iguana/iguana_blocks.c @@ -172,7 +172,7 @@ void _iguana_blocklink(struct iguana_info *coin,struct iguana_block *prev,struct struct iguana_block *iguana_blockhashset(char *debugstr,struct iguana_info *coin,int32_t height,bits256 hash2,int32_t createflag) { - struct iguana_block *block,*prev; + struct iguana_block *block,*prev; int32_t size; /*if ( height > 0 && height > coin->blocks.maxbits ) { printf("%s: illegal height.%d when max.%d, or nonz depth.%d\n",debugstr,height,coin->blocks.maxbits,coin->blockdepth); @@ -206,9 +206,10 @@ struct iguana_block *iguana_blockhashset(char *debugstr,struct iguana_info *coin if ( createflag > 0 ) { portable_mutex_lock(&coin->blocks_mutex); - block = calloc(1,sizeof(*block) + coin->chain->zcash*sizeof(*block->zRO)); + size = (int32_t)((coin->chain->zcash != 0) ? sizeof(struct iguana_zblock) : sizeof(struct iguana_block)); + block = calloc(1,size); block->RO.hash2 = hash2; - block->RO.allocsize = coin->chain->zcash != 0 ? sizeof(*block) : sizeof(struct iguana_zblock); + block->RO.allocsize = size; block->hh.itemind = height, block->height = -1; HASH_ADD(hh,coin->blocks.hash,RO.hash2,sizeof(hash2),block); block->hh.next = block->hh.prev = 0; diff --git a/iguana/iguana_realtime.c b/iguana/iguana_realtime.c index 9e7b49a0f..b81afc1cd 100755 --- a/iguana/iguana_realtime.c +++ b/iguana/iguana_realtime.c @@ -235,7 +235,7 @@ int32_t iguana_realtime_update(struct iguana_info *coin) bp = coin->current; if ( bp == 0 || iguana_validated(coin) < bp->hdrsi ) { - printf("bp.%p validated.%d vs hdrsi.%d\n",bp,iguana_validated(coin),bp->hdrsi); + //printf("bp.%p validated.%d vs hdrsi.%d\n",bp,iguana_validated(coin),bp->hdrsi); return(0); } if ( 1 && coin->RTheight > 0 && coin->spendvectorsaved != 1 && coin->bundlescount-1 != coin->balanceswritten )