Skip to content

Commit 938a8e2

Browse files
committed
[net processing] Annotate m_recently_announced_invs as guarded by g_msgproc_mutex
1 parent 8a2cb1f commit 938a8e2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/net_processing.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ struct CNodeState {
482482
const bool m_is_inbound;
483483

484484
//! A rolling bloom filter of all announced tx CInvs to this peer.
485-
CRollingBloomFilter m_recently_announced_invs = CRollingBloomFilter{INVENTORY_MAX_RECENT_RELAY, 0.000001};
485+
CRollingBloomFilter m_recently_announced_invs GUARDED_BY(NetEventsInterface::g_msgproc_mutex){INVENTORY_MAX_RECENT_RELAY, 0.000001};
486486

487487
CNodeState(bool is_inbound) : m_is_inbound(is_inbound) {}
488488
};
@@ -904,10 +904,12 @@ class PeerManagerImpl final : public PeerManager
904904
std::atomic<std::chrono::seconds> m_last_tip_update{0s};
905905

906906
/** Determine whether or not a peer can request a transaction, and return it (or nullptr if not found or not allowed). */
907-
CTransactionRef FindTxForGetData(const CNode& peer, const GenTxid& gtxid, const std::chrono::seconds mempool_req, const std::chrono::seconds now) LOCKS_EXCLUDED(cs_main);
907+
CTransactionRef FindTxForGetData(const CNode& peer, const GenTxid& gtxid, const std::chrono::seconds mempool_req, const std::chrono::seconds now)
908+
LOCKS_EXCLUDED(cs_main) EXCLUSIVE_LOCKS_REQUIRED(NetEventsInterface::g_msgproc_mutex);
908909

909910
void ProcessGetData(CNode& pfrom, Peer& peer, const std::atomic<bool>& interruptMsgProc)
910-
EXCLUSIVE_LOCKS_REQUIRED(!m_most_recent_block_mutex, peer.m_getdata_requests_mutex) LOCKS_EXCLUDED(::cs_main);
911+
EXCLUSIVE_LOCKS_REQUIRED(!m_most_recent_block_mutex, peer.m_getdata_requests_mutex, NetEventsInterface::g_msgproc_mutex)
912+
LOCKS_EXCLUDED(::cs_main);
911913

912914
/** Process a new block. Perform any post-processing housekeeping */
913915
void ProcessBlock(CNode& node, const std::shared_ptr<const CBlock>& block, bool force_processing, bool min_pow_checked);

0 commit comments

Comments
 (0)