mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-16 10:29:00 +00:00
wallet: Exit IsTrustedTx early if wtx is already in trusted_parents
This commit is contained in:
parent
ae0876ec42
commit
ae888c38d0
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user