From 464823d1349212b886e90e676bc69753afd5b264 Mon Sep 17 00:00:00 2001 From: jl777 Date: Thu, 22 Sep 2016 18:41:46 -0300 Subject: [PATCH] test --- iguana/iguana_spendvectors.c | 4 ++-- iguana/iguana_txidfind.c | 8 ++++---- iguana/iguana_unspents.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/iguana/iguana_spendvectors.c b/iguana/iguana_spendvectors.c index f0437cbda..660cb55b3 100755 --- a/iguana/iguana_spendvectors.c +++ b/iguana/iguana_spendvectors.c @@ -204,8 +204,8 @@ struct iguana_bundle *iguana_fastexternalspent(struct supernet_info *myinfo,stru X = RAMCHAIN_PTR(rdata,Xoffset); //X = (void *)(long)((long)rdata + rdata->Xoffset); *prevhashp = prev_hash = X[ind]; - if ( (unspentind= iguana_unspentindfind(myinfo,coin,&RTspent,0,0,0,0,&height,prev_hash,prev_vout,spent_hdrsi-1,0)) != 0 ) - //if ( (firstvout= iguana_txidfastfind(coin,&height,prev_hash,spent_hdrsi-1)) >= 0 ) + if ( (unspentind= iguana_unspentindfind(myinfo,coin,&RTspent,0,0,0,0,&height,prev_hash,prev_vout,spent_hdrsi-1,0)) > 0 ) + //if ( (firstvout= iguana_txidfastfind(coin,&height,prev_hash,spent_hdrsi-1)) > 0 ) { /*duration = (OS_milliseconds() - startmillis); if ( ((uint64_t)coin->txidfind_num % 100) == 1 ) diff --git a/iguana/iguana_txidfind.c b/iguana/iguana_txidfind.c index 5255dee9a..d8cec460f 100755 --- a/iguana/iguana_txidfind.c +++ b/iguana/iguana_txidfind.c @@ -362,13 +362,13 @@ int32_t iguana_txidfastfind(struct iguana_info *coin,int32_t *heightp,bits256 tx if ( val >= tablesize ) val = 0; if ( (i= hashtable[val]) == 0 ) - return(-1); + return(0); else { if ( i > num ) { printf("illegal val.%d vs num.%d tablesize.%d fastfind.%02x\n",i,num,tablesize,txid.bytes[31]); - return(-1); + return(0); } else { @@ -381,7 +381,7 @@ int32_t iguana_txidfastfind(struct iguana_info *coin,int32_t *heightp,bits256 tx if ( *heightp >= (lasthdrsi+1)*coin->chain->bundlesize ) { printf("txidfastfind: unexpected height.%d with lasthdrsi.%d\n",*heightp,lasthdrsi); - return(-1); + return(0); } return(firstvout); } @@ -403,7 +403,7 @@ int32_t iguana_txidfastfind(struct iguana_info *coin,int32_t *heightp,bits256 tx } } } - return(-1); + return(0); } int32_t iguana_fastfindadd(struct iguana_info *coin,bits256 txid,int32_t height,uint32_t firstvout) diff --git a/iguana/iguana_unspents.c b/iguana/iguana_unspents.c index 51f1d4de1..f04c965d1 100755 --- a/iguana/iguana_unspents.c +++ b/iguana/iguana_unspents.c @@ -73,7 +73,7 @@ int32_t iguana_unspentindfind(struct supernet_info *myinfo,struct iguana_info *c *spentamountp = 0; if ( coinaddr != 0 ) coinaddr[0] = 0; - if ( coin->fastfind != 0 && (firstvout= iguana_txidfastfind(coin,heightp,txid,lasthdrsi)) >= 0 ) + if ( coin->fastfind != 0 && (firstvout= iguana_txidfastfind(coin,heightp,txid,lasthdrsi)) > 0 ) unspentind = (firstvout + vout); else if ( (tp= iguana_txidfind(coin,heightp,&TX,txid,lasthdrsi)) != 0 ) unspentind = (tp->firstvout + vout);