aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Rubin <j@rubin.io>2019-08-30 12:39:41 -0700
committerJeremy Rubin <j@rubin.io>2019-10-21 13:16:22 -0700
commitdce032ce294fe0d531770f540b1de00dc1d13f4b (patch)
tree719a741380e2da0ae86949c7764edc76c1d3f846
parenta22b62481aae95747830bd3c0db3227860b12d8e (diff)
Make IsTrusted scan parents recursively
-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 6adcf15167..5acd0dbf0c 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;
}