From 0c40de31bbf3a9b4dbc8e60396aa1b0af2f7f7c9 Mon Sep 17 00:00:00 2001 From: jl777 Date: Fri, 8 Apr 2016 03:41:39 -0500 Subject: [PATCH] test --- iguana/iguana_bundles.c | 2 +- iguana/iguana_recv.c | 6 +++--- iguana/iguana_unspents.c | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index bcc5ea2e4..0376e2ed6 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -1138,7 +1138,7 @@ void iguana_bundlestats(struct iguana_info *coin,char *str,int32_t lag) iguana_blockQ("stuck",coin,bp,i,block->RO.hash2,1); }*/ } - if ( (n= iguana_bundleissuemissing(coin,bp,1,1.)) > 0 ) + if ( (n= iguana_bundleissuemissing(coin,bp,3,1.)) > 0 ) printf("issued %d priority requests [%d] to unstick stuckiters.%d lag.%d\n",n,bp->hdrsi,coin->stuckiters,lag); //else printf("no bundlerequests issued\n"); } diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 3d5ccd196..79777e9e7 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -941,7 +941,7 @@ struct iguana_bundlereq *iguana_recvblockhashes(struct iguana_info *coin,struct struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana_peer *addr,struct iguana_bundlereq *req,struct iguana_block *origblock,int32_t numtx,int32_t datalen,int32_t recvlen,int32_t *newhwmp) { - struct iguana_bundle *bp=0,*prev; int32_t n,numsaved=0,bundlei = -2; struct iguana_block *block,*tmpblock,*next; char str[65]; bits256 hash2; + struct iguana_bundle *bp=0,*prev; int32_t n,bundlei = -2; struct iguana_block *block,*next; char str[65]; bits256 hash2; if ( bits256_nonz(origblock->RO.prev_block) != 0 ) iguana_blockQ("prev",coin,0,-1,origblock->RO.prev_block,1); if ( (bp= iguana_bundleset(coin,&block,&bundlei,origblock)) != 0 && bp == coin->current && block != 0 && bp->speculative != 0 && bundlei >= 0 ) @@ -974,13 +974,13 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana { int32_t i; static int32_t numrecv; numrecv++; - if ( bp != 0 ) + /*if ( bp != 0 ) { for (i=numsaved=0; in; i++) if ( (tmpblock= bp->blocks[i]) != 0 && tmpblock->fpipbits != 0 && tmpblock->fpos >= 0 && ((bp->hdrsi == 0 && i == 0) || bits256_nonz(tmpblock->RO.prev_block) != 0) ) numsaved++; } - fprintf(stderr,"%s [%d:%d] block.%x | s.%d r.%d copy.%d\n",bits256_str(str,origblock->RO.hash2),bp!=0?bp->hdrsi:-1,bundlei,block!=0?block->fpipbits:0,numsaved,numrecv,req->copyflag); + fprintf(stderr,"%s [%d:%d] block.%x | s.%d r.%d copy.%d\n",bits256_str(str,origblock->RO.hash2),bp!=0?bp->hdrsi:-1,bundlei,block!=0?block->fpipbits:0,numsaved,numrecv,req->copyflag);*/ if ( _iguana_chainlink(coin,block) == 0 ) { next = block; diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 40beb638f..809cb75a2 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -1840,7 +1840,8 @@ int32_t iguana_realtime_update(struct iguana_info *coin) B = (void *)(long)((long)rdata + rdata->Boffset); bundlei = (coin->RTheight % coin->chain->bundlesize); block = iguana_bundleblock(coin,&hash2,bp,bundlei); - bp->blocks[bundlei] = block; + iguana_bundlehashadd(coin,bp,bundlei,block); + //bp->blocks[bundlei] = block; //if ( bits256_nonz(hash2) != 0 ) // iguana_blockhashset("RTset",coin,bp->bundleheight+bundlei,hash2,1); //printf("RT.%d vs hwm.%d starti.%d bp->n %d block.%p/%p ramchain.%p\n",coin->RTheight,coin->blocks.hwmchain.height,coin->RTstarti,bp->n,block,bp->blocks[bundlei],dest->H.data);