Skip to content

Commit dce032c

Browse files
committed
Make IsTrusted scan parents recursively
1 parent a22b624 commit dce032c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/wallet/wallet.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,8 +2319,12 @@ bool CWalletTx::IsTrusted(interfaces::Chain::Lock& locked_chain) const
23192319
if (parent == nullptr)
23202320
return false;
23212321
const CTxOut& parentOut = parent->tx->vout[txin.prevout.n];
2322+
// Check that this specific input being spent is trusted
23222323
if (pwallet->IsMine(parentOut) != ISMINE_SPENDABLE)
23232324
return false;
2325+
// Recurse to check that the parent is also trusted
2326+
if (!parent->IsTrusted(locked_chain))
2327+
return false;
23242328
}
23252329
return true;
23262330
}

0 commit comments

Comments
 (0)