wallet refactor: use CWalletTx member functions to determine tx state

This commit is contained in:
ishaanam
2023-03-01 13:46:23 -05:00
parent ffe5ff1fb6
commit d64922b590
4 changed files with 6 additions and 12 deletions

View File

@@ -752,8 +752,8 @@ bool CWallet::IsSpent(const COutPoint& outpoint) const
const uint256& wtxid = it->second;
const auto mit = mapWallet.find(wtxid);
if (mit != mapWallet.end()) {
int depth = GetTxDepthInMainChain(mit->second);
if (depth > 0 || (depth == 0 && !mit->second.isAbandoned()))
const auto& wtx = mit->second;
if (!wtx.isAbandoned() && !wtx.isBlockConflicted())
return true; // Spent
}
}