|
@ -630,7 +630,7 @@ struct iguana_bundle *iguana_externalspent(struct iguana_info *coin,bits256 *pre |
|
|
//printf("%s height.%d firstvout.%d prev.%d ->U%d\n",bits256_str(str,prev_hash),height,TX.firstvout,prev_vout,unspentind);
|
|
|
//printf("%s height.%d firstvout.%d prev.%d ->U%d\n",bits256_str(str,prev_hash),height,TX.firstvout,prev_vout,unspentind);
|
|
|
now = (uint32_t)time(NULL); |
|
|
now = (uint32_t)time(NULL); |
|
|
duration = (OS_milliseconds() - startmillis); |
|
|
duration = (OS_milliseconds() - startmillis); |
|
|
if ( 0 && ((uint64_t)coin->txidfind_num % 5000000) == 2000000 ) |
|
|
if ( bp == coin->current )// && ((uint64_t)coin->txidfind_num % 5000000) == 2000000 )
|
|
|
printf("%p iguana_txidfind.[%.0f] ave %.2f micros, total %.2f seconds | duration %.3f millis\n",spentbp->ramchain.txbits,coin->txidfind_num,(coin->txidfind_totalmillis*1000.)/coin->txidfind_num,coin->txidfind_totalmillis/1000.,duration); |
|
|
printf("%p iguana_txidfind.[%.0f] ave %.2f micros, total %.2f seconds | duration %.3f millis\n",spentbp->ramchain.txbits,coin->txidfind_num,(coin->txidfind_totalmillis*1000.)/coin->txidfind_num,coin->txidfind_totalmillis/1000.,duration); |
|
|
coin->txidfind_totalmillis += duration; |
|
|
coin->txidfind_totalmillis += duration; |
|
|
coin->txidfind_num += 1.; |
|
|
coin->txidfind_num += 1.; |
|
@ -641,10 +641,9 @@ struct iguana_bundle *iguana_externalspent(struct iguana_info *coin,bits256 *pre |
|
|
iguana_ramchain_prefetch(coin,&spentbp->ramchain,prefetchflag); |
|
|
iguana_ramchain_prefetch(coin,&spentbp->ramchain,prefetchflag); |
|
|
spentbp->lastprefetch = now; |
|
|
spentbp->lastprefetch = now; |
|
|
} |
|
|
} |
|
|
else if ( (rand() % IGUANA_NUMHELPERS) == 0 && (duration > 100 || duration > (100 * coin->txidfind_totalmillis)/coin->txidfind_num) && now >= spentbp->lastprefetch+coin->PREFETCHLAG )//(rand() % (IGUANA_NUMHELPERS>>1)) == 0 && now >= spentbp->lastprefetch+coin->PREFETCHLAG )
|
|
|
else if ( (rand() % IGUANA_NUMHELPERS) == 0 && (duration > 100 || duration > (100 * coin->txidfind_totalmillis)/coin->txidfind_num) && now >= spentbp->lastprefetch ) |
|
|
//if ( duration > 10 && spentbp->lastprefetch == 0 )
|
|
|
|
|
|
{ |
|
|
{ |
|
|
//printf("slow txidfind %.2f vs %.2f prefetch[%d] from.[%d] lag.%ld last.%u\n",duration,coin->txidfind_totalmillis/coin->txidfind_num,spentbp->hdrsi,ramchain->H.data->height/coin->chain->bundlesize,time(NULL) - spentbp->lastprefetch,spentbp->lastprefetch);
|
|
|
printf("slow txidfind %.2f vs %.2f prefetch[%d] from.[%d] lag.%ld last.%u\n",duration,coin->txidfind_totalmillis/coin->txidfind_num,spentbp->hdrsi,ramchain->H.data->height/coin->chain->bundlesize,time(NULL) - spentbp->lastprefetch,spentbp->lastprefetch); |
|
|
iguana_ramchain_prefetch(coin,&spentbp->ramchain,prefetchflag); |
|
|
iguana_ramchain_prefetch(coin,&spentbp->ramchain,prefetchflag); |
|
|
spentbp->lastprefetch = now; |
|
|
spentbp->lastprefetch = now; |
|
|
} |
|
|
} |
|
@ -942,7 +941,7 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp,st |
|
|
uint32_t spent_unspentind,spent_pkind,now,starttime; struct iguana_ramchaindata *rdata; |
|
|
uint32_t spent_unspentind,spent_pkind,now,starttime; struct iguana_ramchaindata *rdata; |
|
|
struct iguana_bundle *spentbp; struct iguana_blockRO *B; struct iguana_spendvector *ptr; |
|
|
struct iguana_bundle *spentbp; struct iguana_blockRO *B; struct iguana_spendvector *ptr; |
|
|
struct iguana_unspent *u,*spentU; struct iguana_txid *T; char str[65]; struct iguana_spend *S,*s; |
|
|
struct iguana_unspent *u,*spentU; struct iguana_txid *T; char str[65]; struct iguana_spend *S,*s; |
|
|
printf("iguana_spendvectors.[%d] gen.%d ramchain data.%p\n",bp->hdrsi,bp->bundleheight,ramchain->H.data); |
|
|
printf("iguana_spendvectors.[%d] gen.%d ramchain data.%p txbits.%p\n",bp->hdrsi,bp->bundleheight,ramchain->H.data,ramchain->txbits); |
|
|
if ( (rdata= ramchain->H.data) == 0 || (n= rdata->numspends) < 1 ) |
|
|
if ( (rdata= ramchain->H.data) == 0 || (n= rdata->numspends) < 1 ) |
|
|
{ |
|
|
{ |
|
|
printf("iguana_spendvectors: no rdata.%p %d\n",rdata,n); |
|
|
printf("iguana_spendvectors: no rdata.%p %d\n",rdata,n); |
|
@ -1048,7 +1047,7 @@ int32_t iguana_spendvectors(struct iguana_info *coin,struct iguana_bundle *bp,st |
|
|
ptr[emit].fromheight = bp->bundleheight + i; |
|
|
ptr[emit].fromheight = bp->bundleheight + i; |
|
|
ptr[emit].tmpflag = 1; |
|
|
ptr[emit].tmpflag = 1; |
|
|
if ( 1 && bp == coin->current ) |
|
|
if ( 1 && bp == coin->current ) |
|
|
printf("ht.%d spends [%d] TMPVECTOR u%d\n",ptr[emit].fromheight,ptr[emit].hdrsi,ptr[emit].unspentind); |
|
|
printf("fromht.%d spends [%d] TMPVECTOR u%d s%u\n",ptr[emit].fromheight,ptr[emit].hdrsi,ptr[emit].unspentind,spendind); |
|
|
emit++; |
|
|
emit++; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|