Browse Source

test

release/v0.1
jl777 9 years ago
parent
commit
a09ca272a6
  1. 16
      iguana/iguana_ramchain.c
  2. 2
      iguana/iguana_unspents.c

16
iguana/iguana_ramchain.c

@ -211,17 +211,21 @@ struct iguana_txid *iguana_txidfind(struct iguana_info *coin,int32_t *heightp,st
{ {
TXbits = (void *)(long)((long)ramchain->H.data + ramchain->H.data->TXoffset); TXbits = (void *)(long)((long)ramchain->H.data + ramchain->H.data->TXoffset);
T = (void *)(long)((long)ramchain->H.data + ramchain->H.data->Toffset); T = (void *)(long)((long)ramchain->H.data + ramchain->H.data->Toffset);
//printf("search bp.%p TXbits.%p T.%p %d %d\n",bp,TXbits,T,(int32_t)ramchain->H.data->TXoffset,(int32_t)ramchain->H.data->Toffset); printf("search bp.%p TXbits.%p T.%p %d %d\n",bp,TXbits,T,(int32_t)ramchain->H.data->TXoffset,(int32_t)ramchain->H.data->Toffset);
if ( (txidind= iguana_sparseaddtx(TXbits,ramchain->H.data->txsparsebits,ramchain->H.data->numtxsparse,txid,T,0)) > 0 ) if ( (txidind= iguana_sparseaddtx(TXbits,ramchain->H.data->txsparsebits,ramchain->H.data->numtxsparse,txid,T,0)) > 0 )
{ {
//printf("found txidind.%d\n",txidind); printf("found txidind.%d\n",txidind);
for (j=0; j<bp->n; j++) for (j=0; j<bp->n; j++)
if ( (block= bp->blocks[j]) != 0 && txidind >= block->RO.firsttxidind && txidind < block->RO.firsttxidind+block->RO.txn_count ) if ( (block= bp->blocks[j]) != 0 && txidind >= block->RO.firsttxidind && txidind < block->RO.firsttxidind+block->RO.txn_count )
break; break;
*heightp = bp->bundleheight + j; if ( j < bp->n )
//printf("found height.%d\n",*heightp); {
*tx = T[txidind]; *heightp = bp->bundleheight + j;
return(tx); printf("found height.%d\n",*heightp);
*tx = T[txidind];
return(tx);
}
printf("didnt find expected txidind.%d\n",txidind);
} }
} }
} }

2
iguana/iguana_unspents.c

@ -97,7 +97,7 @@ struct iguana_bundle *iguana_spent(struct iguana_info *coin,bits256 *prevhashp,u
{ {
unspentind = TX.firstvout + ((prev_vout > 0) ? prev_vout : 0); unspentind = TX.firstvout + ((prev_vout > 0) ? prev_vout : 0);
hdrsi = height / coin->chain->bundlesize; hdrsi = height / coin->chain->bundlesize;
//printf("height.%d firstvout.%d prev.%d ->U%d\n",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);
} }
else else
{ {

Loading…
Cancel
Save