wallet: Exit IsTrustedTx early if wtx is already in trusted_parents

This commit is contained in:
Ava Chow committed 2025-06-25 14:08:49 -07:00
1 parent ae0876ec42
commit ae888c38d0
1 file changed
+4
+4
View File
@@ -257,6 +257,10 @@ bool CachedTxIsFromMe(const CWallet& wallet, const CWalletTx& wtx, const isminef
bool CachedTxIsTrusted(const CWallet& wallet, const CWalletTx& wtx, std::set<Txid>& trusted_parents)
{
AssertLockHeld(wallet.cs_wallet);
// This wtx is already trusted
if (trusted_parents.contains(wtx.GetHash())) return true;
if (wtx.isConfirmed()) return true;
if (wtx.isBlockConflicted()) return false;
// using wtx's cached debit