From 4f4db5299b4c89862976f048fc4dadb78600ab45 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 7 Jul 2019 05:46:50 -1100 Subject: [PATCH] Check for spent utxo --- src/komodo_nSPV.h | 2 -- src/komodo_nSPV_wallet.h | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/komodo_nSPV.h b/src/komodo_nSPV.h index 3feeec7d0..b0dca61c6 100644 --- a/src/komodo_nSPV.h +++ b/src/komodo_nSPV.h @@ -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 diff --git a/src/komodo_nSPV_wallet.h b/src/komodo_nSPV_wallet.h index cfecd2a31..74bd61639 100644 --- a/src/komodo_nSPV_wallet.h +++ b/src/komodo_nSPV_wallet.h @@ -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;