Make IsTrusted scan parents recursively

This commit is contained in:
Jeremy Rubin 2019-08-30 12:39:41 -07:00
parent a22b62481a
commit dce032ce29

View file

@ -2319,8 +2319,12 @@ bool CWalletTx::IsTrusted(interfaces::Chain::Lock& locked_chain) const
if (parent == nullptr) if (parent == nullptr)
return false; return false;
const CTxOut& parentOut = parent->tx->vout[txin.prevout.n]; const CTxOut& parentOut = parent->tx->vout[txin.prevout.n];
// Check that this specific input being spent is trusted
if (pwallet->IsMine(parentOut) != ISMINE_SPENDABLE) if (pwallet->IsMine(parentOut) != ISMINE_SPENDABLE)
return false; return false;
// Recurse to check that the parent is also trusted
if (!parent->IsTrusted(locked_chain))
return false;
} }
return true; return true;
} }