From dce032ce294fe0d531770f540b1de00dc1d13f4b Mon Sep 17 00:00:00 2001 From: Jeremy Rubin Date: Fri, 30 Aug 2019 12:39:41 -0700 Subject: Make IsTrusted scan parents recursively --- src/wallet/wallet.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- cgit v1.2.3