jl777 8 years ago
parent
commit
464823d134
  1. 4
      iguana/iguana_spendvectors.c
  2. 8
      iguana/iguana_txidfind.c
  3. 2
      iguana/iguana_unspents.c

4
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 )

8
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)

2
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);

Loading…
Cancel
Save