Make IsTrusted scan parents recursively
This commit is contained in:
1 parent
a22b62481a
commit
dce032ce29
1 file changed
+4
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user