Skip to content

Commit ae888c3

Browse files
committed
wallet: Exit IsTrustedTx early if wtx is already in trusted_parents
1 parent ae0876e commit ae888c3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/wallet/receive.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,10 @@ bool CachedTxIsFromMe(const CWallet& wallet, const CWalletTx& wtx, const isminef
257257
bool CachedTxIsTrusted(const CWallet& wallet, const CWalletTx& wtx, std::set<Txid>& trusted_parents)
258258
{
259259
AssertLockHeld(wallet.cs_wallet);
260+
261+
// This wtx is already trusted
262+
if (trusted_parents.contains(wtx.GetHash())) return true;
263+
260264
if (wtx.isConfirmed()) return true;
261265
if (wtx.isBlockConflicted()) return false;
262266
// using wtx's cached debit

0 commit comments

Comments
 (0)