Skip to content

Commit 06ebdc8

Browse files
committed
net/net_processing: add missing thread safety annotations
1 parent e191fac commit 06ebdc8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/net.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ class CNode
368368

369369
RecursiveMutex cs_vProcessMsg;
370370
std::list<CNetMessage> vProcessMsg GUARDED_BY(cs_vProcessMsg);
371-
size_t nProcessQueueSize{0};
371+
size_t nProcessQueueSize GUARDED_BY(cs_vProcessMsg){0};
372372

373373
RecursiveMutex cs_sendProcessing;
374374

src/net_processing.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ struct Peer {
289289
* non-wtxid-relay peers, wtxid for wtxid-relay peers). We use the
290290
* mempool to sort transactions in dependency order before relay, so
291291
* this does not have to be sorted. */
292-
std::set<uint256> m_tx_inventory_to_send;
292+
std::set<uint256> m_tx_inventory_to_send GUARDED_BY(m_tx_inventory_mutex);
293293
/** Whether the peer has requested us to send our complete mempool. Only
294294
* permitted if the peer has NetPermissionFlags::Mempool. See BIP35. */
295295
bool m_send_mempool GUARDED_BY(m_tx_inventory_mutex){false};
@@ -648,7 +648,7 @@ class PeerManagerImpl final : public PeerManager
648648
std::atomic<int> m_best_height{-1};
649649

650650
/** Next time to check for stale tip */
651-
std::chrono::seconds m_stale_tip_check_time{0s};
651+
std::chrono::seconds m_stale_tip_check_time GUARDED_BY(cs_main){0s};
652652

653653
/** Whether this node is running in -blocksonly mode */
654654
const bool m_ignore_incoming_txs;
@@ -657,7 +657,7 @@ class PeerManagerImpl final : public PeerManager
657657

658658
/** Whether we've completed initial sync yet, for determining when to turn
659659
* on extra block-relay-only peers. */
660-
bool m_initial_sync_finished{false};
660+
bool m_initial_sync_finished GUARDED_BY(cs_main){false};
661661

662662
/** Protects m_peer_map. This mutex must not be locked while holding a lock
663663
* on any of the mutexes inside a Peer object. */

0 commit comments

Comments
 (0)