aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
authorJeremy Rubin <[email protected]>2019-08-30 12:39:41 -0700
committerJeremy Rubin <[email protected]>2019-10-21 13:16:22 -0700
commitdce032ce294fe0d531770f540b1de00dc1d13f4b (patch)
tree719a741380e2da0ae86949c7764edc76c1d3f846 /src/wallet/wallet.cpp
parentMerge #17070: wallet: Avoid showing GUI popups on RPC errors (diff)
downloaddiscoin-dce032ce294fe0d531770f540b1de00dc1d13f4b.tar.xz
discoin-dce032ce294fe0d531770f540b1de00dc1d13f4b.zip
Make IsTrusted scan parents recursively
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 6adcf1516..5acd0dbf0 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -2319,8 +2319,12 @@ bool CWalletTx::IsTrusted(interfaces::Chain::Lock& locked_chain) const
if (parent == nullptr)
return false;
const CTxOut& parentOut = parent->tx->vout[txin.prevout.n];
+ // Check that this specific input being spent is trusted
if (pwallet->IsMine(parentOut) != ISMINE_SPENDABLE)
return false;
+ // Recurse to check that the parent is also trusted
+ if (!parent->IsTrusted(locked_chain))
+ return false;
}
return true;
}