@@ -697,6 +697,8 @@ class PeerManagerImpl final : public PeerManager
697
697
698
698
FastRandomContext m_rng GUARDED_BY (NetEventsInterface::g_msgproc_mutex);
699
699
700
+ FeeFilterRounder m_fee_filter_rounder GUARDED_BY (NetEventsInterface::g_msgproc_mutex);
701
+
700
702
const CChainParams& m_chainparams;
701
703
CConnman& m_connman;
702
704
AddrMan& m_addrman;
@@ -1811,6 +1813,7 @@ PeerManagerImpl::PeerManagerImpl(CConnman& connman, AddrMan& addrman,
1811
1813
BanMan* banman, ChainstateManager& chainman,
1812
1814
CTxMemPool& pool, Options opts)
1813
1815
: m_rng{opts.deterministic_rng },
1816
+ m_fee_filter_rounder{CFeeRate{DEFAULT_MIN_RELAY_TX_FEE}},
1814
1817
m_chainparams (chainman.GetParams()),
1815
1818
m_connman(connman),
1816
1819
m_addrman(addrman),
@@ -5338,22 +5341,21 @@ void PeerManagerImpl::MaybeSendFeefilter(CNode& pto, Peer& peer, std::chrono::mi
5338
5341
if (pto.IsBlockOnlyConn ()) return ;
5339
5342
5340
5343
CAmount currentFilter = m_mempool.GetMinFee ().GetFeePerK ();
5341
- static FeeFilterRounder g_filter_rounder{CFeeRate{DEFAULT_MIN_RELAY_TX_FEE}};
5342
5344
5343
5345
if (m_chainman.IsInitialBlockDownload ()) {
5344
5346
// Received tx-inv messages are discarded when the active
5345
5347
// chainstate is in IBD, so tell the peer to not send them.
5346
5348
currentFilter = MAX_MONEY;
5347
5349
} else {
5348
- static const CAmount MAX_FILTER{g_filter_rounder .round (MAX_MONEY)};
5350
+ static const CAmount MAX_FILTER{m_fee_filter_rounder .round (MAX_MONEY)};
5349
5351
if (peer.m_fee_filter_sent == MAX_FILTER) {
5350
5352
// Send the current filter if we sent MAX_FILTER previously
5351
5353
// and made it out of IBD.
5352
5354
peer.m_next_send_feefilter = 0us;
5353
5355
}
5354
5356
}
5355
5357
if (current_time > peer.m_next_send_feefilter ) {
5356
- CAmount filterToSend = g_filter_rounder .round (currentFilter);
5358
+ CAmount filterToSend = m_fee_filter_rounder .round (currentFilter);
5357
5359
// We always have a fee filter of at least the min relay fee
5358
5360
filterToSend = std::max (filterToSend, m_mempool.m_min_relay_feerate .GetFeePerK ());
5359
5361
if (filterToSend != peer.m_fee_filter_sent ) {
0 commit comments