Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
97434f9678
  1. 6
      iguana/iguana_recv.c
  2. 15
      iguana/iguana_unspents.c

6
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 = iguana_bundlereq(coin,addr,'S',0);
req->hashes = blockhashes, req->n = n; req->hashes = blockhashes, req->n = n;
char str[65]; char str[65];
//if ( 0 && n > 2 ) if ( 0 && n > 2 )
printf("bundlesQ blockhashes.%s [%d]\n",bits256_str(str,blockhashes[1]),n); printf("bundlesQ blockhashes.%s [%d]\n",bits256_str(str,blockhashes[1]),n);
queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); 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) /*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 ) if ( bp != 0 )
bp->dirty++; 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; int32_t i; static int32_t numrecv;
numrecv++; numrecv++;

15
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); printf("tableentries.%d\n",n);
} }
/*ramchain->sparsesearches++; ramchain->sparsesearches++;
if ( (ramchain->sparsesearches % 100000) == 0 ) 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 ) if ( width == 32 )
{ {
table = (uint32_t *)bits; 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 ) if ( (retval= setind) != 0 )
table[ind] = setind; table[ind] = setind;
if ( ++i > ramchain->sparsemax )
ramchain->sparsemax = i;
ramchain->sparseiters += i;
return(setind); return(setind);
} }
else if ( memcmp((void *)(long)((long)refdata + x*refsize),key,keylen) == 0 ) else if ( memcmp((void *)(long)((long)refdata + x*refsize),key,keylen) == 0 )
{ {
if ( setind != 0 && setind != x ) if ( setind != 0 && setind != x )
printf("sparseadd index collision setind.%d != x.%d refsize.%d keylen.%d\n",setind,x,refsize,keylen); 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); return(x);
} }
//if ( ++i > ramchain->sparsemax )
// ramchain->sparsemax = i;
//ramchain->sparseiters += i;
} }
} }
else else

Loading…
Cancel
Save