Check for spent utxo

This commit is contained in:
jl777
2019-07-07 05:46:50 -11:00
parent 45161da432
commit 4f4db5299b
2 changed files with 1 additions and 3 deletions

View File

@@ -17,8 +17,6 @@
// todo:
// make sure no files are updated (this is to allow nSPV=1 and later nSPV=0 without affecting database)
// determine if it makes sense to be scanning mempool for the utxo/spentinfo requests, maybe can add isspent flag to txproof, or just use getspentinfo if broadcast fails
// pubkeys extract
// headers "sync"
// interest calculations are currently just using what is returned, it should calculate it from scratch

View File

@@ -58,7 +58,7 @@ int32_t NSPV_gettransaction(int32_t vout,uint256 txid,int32_t height,CTransactio
{
int32_t offset,retval = 0;
NSPV_txproof(vout,txid,height);
if ( NSPV_txproofresult.txid != txid )
if ( NSPV_txproofresult.txid != txid || NSPV_txproofresult.unspentsatoshis <= 0 )
return(-1);
else if ( NSPV_txextract(tx,NSPV_txproofresult.tx,NSPV_txproofresult.txlen) < 0 || NSPV_txproofresult.txlen <= 0 )
retval = -20;