diff options
author | Jeremy Rubin <j@rubin.io> | 2019-08-30 12:39:41 -0700 |
---|---|---|
committer | Jeremy Rubin <j@rubin.io> | 2019-10-21 13:16:22 -0700 |
commit | dce032ce294fe0d531770f540b1de00dc1d13f4b (patch) | |
tree | 719a741380e2da0ae86949c7764edc76c1d3f846 | |
parent | a22b62481aae95747830bd3c0db3227860b12d8e (diff) |
Make IsTrusted scan parents recursively
-rw-r--r-- | src/wallet/wallet.cpp | 4 |
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; } |