mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-16 10:30:41 +01:00
wallet: Exit IsTrustedTx early if wtx is already in trusted_parents
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user