mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 20:03:34 -03:00
Make IsTrusted scan parents recursively
This commit is contained in:
parent
a22b62481a
commit
dce032ce29
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue