wallet: Exit IsTrustedTx early if wtx is already in trusted_parents
This commit is contained in:
1 parent
ae0876ec42
commit
ae888c38d0
1 file changed
+4
@@ -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)
|
bool CachedTxIsTrusted(const CWallet& wallet, const CWalletTx& wtx, std::set<Txid>& trusted_parents)
|
||||||
{
|
{
|
||||||
AssertLockHeld(wallet.cs_wallet);
|
AssertLockHeld(wallet.cs_wallet);
|
||||||
|
|
||||||
|
// This wtx is already trusted
|
||||||
|
if (trusted_parents.contains(wtx.GetHash())) return true;
|
||||||
|
|
||||||
if (wtx.isConfirmed()) return true;
|
if (wtx.isConfirmed()) return true;
|
||||||
if (wtx.isBlockConflicted()) return false;
|
if (wtx.isBlockConflicted()) return false;
|
||||||
// using wtx's cached debit
|
// using wtx's cached debit
|
||||||
|
|||||||
Reference in new issue
Block a user