From 97434f9678da8df40041b332ec990047500218ef Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 28 Mar 2016 01:20:19 -0300 Subject: [PATCH] test --- iguana/iguana_recv.c | 6 ++++-- iguana/iguana_unspents.c | 15 +++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 32560af78..903957849 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -315,9 +315,11 @@ void iguana_gotblockhashesM(struct iguana_info *coin,struct iguana_peer *addr,bi req = iguana_bundlereq(coin,addr,'S',0); req->hashes = blockhashes, req->n = n; char str[65]; - //if ( 0 && n > 2 ) + if ( 0 && n > 2 ) printf("bundlesQ blockhashes.%s [%d]\n",bits256_str(str,blockhashes[1]),n); queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); + if ( n > coin->chain->bundlesize ) + iguana_blockQ("hashesM",coin,0,-1,blockhashes[1],0); } /*void iguana_patch(struct iguana_info *coin,struct iguana_block *block) @@ -793,7 +795,7 @@ struct iguana_bundlereq *iguana_recvblock(struct iguana_info *coin,struct iguana } if ( bp != 0 ) bp->dirty++; - if ( 0 )//&& bp != 0 && bp->hdrsi == coin->bundlescount-1 ) + if ( 1 )//&& bp != 0 && bp->hdrsi == coin->bundlescount-1 ) { int32_t i; static int32_t numrecv; numrecv++; diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 40a2a1777..a6be30f59 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -185,9 +185,9 @@ uint32_t iguana_sparseadd(uint8_t *bits,uint32_t ind,int32_t width,uint32_t tabl } printf("tableentries.%d\n",n); } - /*ramchain->sparsesearches++; + ramchain->sparsesearches++; if ( (ramchain->sparsesearches % 100000) == 0 ) - printf("[%3d] %7d.[%-2d %8d] %5.3f sparse searches.%-10ld iters.%-10ld hits.%-10ld %5.2f%% max.%ld\n",ramchain->height/ramchain->H.data->numblocks,ramchain->height,width,tablesize,(double)ramchain->sparseiters/(1+ramchain->sparsesearches),ramchain->sparsesearches,ramchain->sparseiters,ramchain->sparsehits,100.*(double)ramchain->sparsehits/(1+ramchain->sparsesearches),ramchain->sparsemax+1);*/ + printf("[%3d] %7d.[%-2d %8d] %5.3f sparse searches.%-10ld iters.%-10ld hits.%-10ld %5.2f%% max.%ld\n",ramchain->height/ramchain->H.data->numblocks,ramchain->height,width,tablesize,(double)ramchain->sparseiters/(1+ramchain->sparsesearches),ramchain->sparsesearches,ramchain->sparseiters,ramchain->sparsehits,100.*(double)ramchain->sparsehits/(1+ramchain->sparsesearches),ramchain->sparsemax+1); if ( width == 32 ) { table = (uint32_t *)bits; @@ -199,18 +199,21 @@ uint32_t iguana_sparseadd(uint8_t *bits,uint32_t ind,int32_t width,uint32_t tabl { if ( (retval= setind) != 0 ) table[ind] = setind; + if ( ++i > ramchain->sparsemax ) + ramchain->sparsemax = i; + ramchain->sparseiters += i; return(setind); } else if ( memcmp((void *)(long)((long)refdata + x*refsize),key,keylen) == 0 ) { if ( setind != 0 && setind != x ) printf("sparseadd index collision setind.%d != x.%d refsize.%d keylen.%d\n",setind,x,refsize,keylen); - //else ramchain->sparsehits++; + ramchain->sparsehits++; + if ( ++i > ramchain->sparsemax ) + ramchain->sparsemax = i; + ramchain->sparseiters += i; return(x); } - //if ( ++i > ramchain->sparsemax ) - // ramchain->sparsemax = i; - //ramchain->sparseiters += i; } } else