Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
6623b2c59f
  1. 2
      iguana/iguana_recv.c
  2. 14
      iguana/iguana_unspents.c

2
iguana/iguana_recv.c

@ -1201,7 +1201,7 @@ int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle
req->height = height; req->height = height;
req->bundlei = bundlei; req->bundlei = bundlei;
char str2[65]; char str2[65];
if ( 0 && (bundlei % 250) == 0 ) if ( Q == &coin->blocksQ && queue_size(Q) > 100000 )
printf("%s %s %s [%d:%d] %d %s %d numranked.%d qsize.%d\n",coin->symbol,argstr,str,bp!=0?bp->hdrsi:-1,bundlei,req->height,bits256_str(str2,hash2),coin->blocks.recvblocks,coin->peers.numranked,queue_size(Q)); printf("%s %s %s [%d:%d] %d %s %d numranked.%d qsize.%d\n",coin->symbol,argstr,str,bp!=0?bp->hdrsi:-1,bundlei,req->height,bits256_str(str2,hash2),coin->blocks.recvblocks,coin->peers.numranked,queue_size(Q));
if ( block != 0 ) if ( block != 0 )
{ {

14
iguana/iguana_unspents.c

@ -592,7 +592,7 @@ int32_t iguana_balancegen(struct iguana_info *coin,struct iguana_bundle *bp,int3
int32_t iguana_RTutxo(struct iguana_info *coin,struct iguana_bundle *bp,struct iguana_ramchain *RTramchain,int32_t bundlei) int32_t iguana_RTutxo(struct iguana_info *coin,struct iguana_bundle *bp,struct iguana_ramchain *RTramchain,int32_t bundlei)
{ {
struct iguana_txid *T,*spentT; int32_t height,spendind,txidind,j,k; bits256 prevhash; struct iguana_txid *T; int32_t height,spendind,txidind,j,k; bits256 prevhash;
struct iguana_bundle *spentbp; struct iguana_unspent *spentU,*u; struct iguana_bundle *spentbp; struct iguana_unspent *spentU,*u;
struct iguana_ramchaindata *RTdata; struct iguana_ramchaindata *RTdata;
uint32_t spent_unspentind; struct iguana_blockRO *B; struct iguana_spend *S,*s; uint32_t spent_unspentind; struct iguana_blockRO *B; struct iguana_spend *S,*s;
@ -630,15 +630,14 @@ int32_t iguana_RTutxo(struct iguana_info *coin,struct iguana_bundle *bp,struct i
else if ( s->prevout >= 0 ) else if ( s->prevout >= 0 )
{ {
spentbp = bp; spentbp = bp;
if ( spentbp->ramchain.H.data != 0 && s->spendtxidind != 0 && s->spendtxidind < spentbp->ramchain.H.data->numtxids ) if ( s->spendtxidind != 0 && s->spendtxidind < RTdata->numtxids )
{ {
spentT = (void *)(long)((long)spentbp->ramchain.H.data + spentbp->ramchain.H.data->Toffset); spent_unspentind = T[s->spendtxidind].firstvout + s->prevout;
spent_unspentind = spentT[s->spendtxidind].firstvout + s->prevout;
//printf("txidind.%d 1st.%d prevout.%d\n",txidind,T[txidind].firstvout,s->prevout); //printf("txidind.%d 1st.%d prevout.%d\n",txidind,T[txidind].firstvout,s->prevout);
} }
else else
{ {
printf("RTutxo txidind overflow %u vs %d\n",s->spendtxidind,spentbp->ramchain.H.data != 0?spentbp->ramchain.H.data->numtxids:-1); printf("RTutxo txidind overflow %u vs %d\n",s->spendtxidind,RTdata->numtxids);
return(-1); return(-1);
} }
} }
@ -647,7 +646,8 @@ int32_t iguana_RTutxo(struct iguana_info *coin,struct iguana_bundle *bp,struct i
{ {
spentU = (void *)(long)((long)spentbp->ramchain.H.data + spentbp->ramchain.H.data->Uoffset); spentU = (void *)(long)((long)spentbp->ramchain.H.data + spentbp->ramchain.H.data->Uoffset);
u = &spentU[spent_unspentind]; u = &spentU[spent_unspentind];
return(iguana_volatileupdate(coin,1,spentbp == bp ? RTramchain : &spentbp->ramchain,spentbp->hdrsi,spent_unspentind,u->pkind,u->value,spendind,height)); if ( iguana_volatileupdate(coin,1,spentbp == bp ? RTramchain : &spentbp->ramchain,spentbp->hdrsi,spent_unspentind,u->pkind,u->value,spendind,height) < 0 )
return(-1);
} else printf("RTutxo error spentbp.%p u.%u\n",spentbp,spent_unspentind); } else printf("RTutxo error spentbp.%p u.%u\n",spentbp,spent_unspentind);
} }
} }
@ -1124,7 +1124,7 @@ int32_t iguana_balancecalc(struct iguana_info *coin,struct iguana_bundle *bp,int
} }
} }
//printf("B [%d] j.%d u.%u b.%u\n",bp->hdrsi,j,bp->utxofinish,bp->balancefinish); //printf("B [%d] j.%d u.%u b.%u\n",bp->hdrsi,j,bp->utxofinish,bp->balancefinish);
if ( bp->utxofinish > 1 && bp->balancefinish <= 1 && bp->hdrsi == j ) if ( bp->bundleheight+bp->n >= coin->blocks.hwmchain.height && bp->utxofinish > 1 && bp->balancefinish <= 1 && bp->hdrsi == j )
{ {
starttime = (uint32_t)time(NULL); starttime = (uint32_t)time(NULL);
for (j=0; j<=bp->hdrsi; j++) for (j=0; j<=bp->hdrsi; j++)

Loading…
Cancel
Save