@@ -861,11 +861,9 @@ class PeerManagerImpl final : public PeerManager
861
861
* - m_recent_rejects
862
862
* - m_recent_rejects_reconsiderable (if include_reconsiderable = true)
863
863
* - m_recent_confirmed_transactions
864
- * Also responsible for resetting m_recent_rejects and m_recent_rejects_reconsiderable if the
865
- * chain tip has changed.
866
864
* */
867
865
bool AlreadyHaveTx (const GenTxid& gtxid, bool include_reconsiderable)
868
- EXCLUSIVE_LOCKS_REQUIRED(cs_main, !m_recent_confirmed_transactions_mutex, m_tx_download_mutex);
866
+ EXCLUSIVE_LOCKS_REQUIRED(!m_recent_confirmed_transactions_mutex, m_tx_download_mutex);
869
867
870
868
/* *
871
869
* Filter for transactions that were recently rejected by the mempool.
@@ -902,9 +900,6 @@ class PeerManagerImpl final : public PeerManager
902
900
* Memory used: 1.3 MB
903
901
*/
904
902
CRollingBloomFilter m_recent_rejects GUARDED_BY (m_tx_download_mutex){120'000 , 0.000'001 };
905
- /* * Block hash of chain tip the last time we reset m_recent_rejects and
906
- * m_recent_rejects_reconsiderable. */
907
- uint256 hashRecentRejectsChainTip GUARDED_BY (m_tx_download_mutex);
908
903
909
904
/* *
910
905
* Filter for:
@@ -2088,7 +2083,6 @@ void PeerManagerImpl::ActiveTipChange(const CBlockIndex* new_tip, bool is_ibd)
2088
2083
// see them again.
2089
2084
m_recent_rejects.reset ();
2090
2085
m_recent_rejects_reconsiderable.reset ();
2091
- hashRecentRejectsChainTip = new_tip->GetBlockHash ();
2092
2086
}
2093
2087
}
2094
2088
@@ -2292,23 +2286,8 @@ void PeerManagerImpl::BlockChecked(const CBlock& block, const BlockValidationSta
2292
2286
2293
2287
bool PeerManagerImpl::AlreadyHaveTx (const GenTxid& gtxid, bool include_reconsiderable)
2294
2288
{
2295
- AssertLockHeld (::cs_main);
2296
2289
AssertLockHeld (m_tx_download_mutex);
2297
2290
2298
- // Since recent_rejects is updated whenever the tip changes, and hashRecentRejectsChainTip is
2299
- // not set until the first time it is called outside of IBD, hashRecentRejectsChainTip should
2300
- // always be up to date with the current chain tip.
2301
- if (!Assume (hashRecentRejectsChainTip == uint256::ZERO ||
2302
- hashRecentRejectsChainTip == m_chainman.ActiveChain ().Tip ()->GetBlockHash ())) {
2303
- // If the chain tip has changed previously rejected transactions
2304
- // might be now valid, e.g. due to a nLockTime'd tx becoming valid,
2305
- // or a double-spend. Reset the rejects filter and give those
2306
- // txs a second chance.
2307
- hashRecentRejectsChainTip = m_chainman.ActiveChain ().Tip ()->GetBlockHash ();
2308
- m_recent_rejects.reset ();
2309
- m_recent_rejects_reconsiderable.reset ();
2310
- }
2311
-
2312
2291
const uint256& hash = gtxid.GetHash ();
2313
2292
2314
2293
if (gtxid.IsWtxid ()) {
0 commit comments