aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnthony Towns <aj@erisian.com.au>2022-05-20 05:31:34 +1000
committerAnthony Towns <aj@erisian.com.au>2022-08-29 22:50:51 +1000
commit06ebdc886fcb4ca22f695bafe0956cff6d70a250 (patch)
tree8fba13bd569270cb5eff967c6f78313bbb25126b /src
parente191fac4f3c37820f0618f72f0a8e8b524531ab8 (diff)
downloadbitcoin-06ebdc886fcb4ca22f695bafe0956cff6d70a250.tar.xz
net/net_processing: add missing thread safety annotations
Diffstat (limited to 'src')
-rw-r--r--src/net.h2
-rw-r--r--src/net_processing.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/net.h b/src/net.h
index 7156a2259f..064c448264 100644
--- a/src/net.h
+++ b/src/net.h
@@ -368,7 +368,7 @@ public:
RecursiveMutex cs_vProcessMsg;
std::list<CNetMessage> vProcessMsg GUARDED_BY(cs_vProcessMsg);
- size_t nProcessQueueSize{0};
+ size_t nProcessQueueSize GUARDED_BY(cs_vProcessMsg){0};
RecursiveMutex cs_sendProcessing;
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index b83034463d..fff7f86d78 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -289,7 +289,7 @@ struct Peer {
* non-wtxid-relay peers, wtxid for wtxid-relay peers). We use the
* mempool to sort transactions in dependency order before relay, so
* this does not have to be sorted. */
- std::set<uint256> m_tx_inventory_to_send;
+ std::set<uint256> m_tx_inventory_to_send GUARDED_BY(m_tx_inventory_mutex);
/** Whether the peer has requested us to send our complete mempool. Only
* permitted if the peer has NetPermissionFlags::Mempool. See BIP35. */
bool m_send_mempool GUARDED_BY(m_tx_inventory_mutex){false};
@@ -648,7 +648,7 @@ private:
std::atomic<int> m_best_height{-1};
/** Next time to check for stale tip */
- std::chrono::seconds m_stale_tip_check_time{0s};
+ std::chrono::seconds m_stale_tip_check_time GUARDED_BY(cs_main){0s};
/** Whether this node is running in -blocksonly mode */
const bool m_ignore_incoming_txs;
@@ -657,7 +657,7 @@ private:
/** Whether we've completed initial sync yet, for determining when to turn
* on extra block-relay-only peers. */
- bool m_initial_sync_finished{false};
+ bool m_initial_sync_finished GUARDED_BY(cs_main){false};
/** Protects m_peer_map. This mutex must not be locked while holding a lock
* on any of the mutexes inside a Peer object. */