Skip to content

Commit 5f80d8d

Browse files
committed
[net processing] Annotate nUnconnectingHeaders as guarded by g_msgproc_mutex
1 parent 1d87137 commit 5f80d8d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/net_processing.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ struct CNodeState {
415415
//! The best header we have sent our peer.
416416
const CBlockIndex* pindexBestHeaderSent{nullptr};
417417
//! Length of current-streak of unconnecting headers announcements
418-
int nUnconnectingHeaders{0};
418+
int nUnconnectingHeaders GUARDED_BY(NetEventsInterface::g_msgproc_mutex){0};
419419
//! Whether we've started headers synchronization with this peer.
420420
bool fSyncStarted{false};
421421
//! When to potentially disconnect peer for stalling headers download
@@ -666,7 +666,8 @@ class PeerManagerImpl final : public PeerManager
666666
/** Potentially fetch blocks from this peer upon receipt of a new headers tip */
667667
void HeadersDirectFetchBlocks(CNode& pfrom, const Peer& peer, const CBlockIndex& last_header);
668668
/** Update peer state based on received headers message */
669-
void UpdatePeerStateForReceivedHeaders(CNode& pfrom, const CBlockIndex& last_header, bool received_new_header, bool may_have_more_headers);
669+
void UpdatePeerStateForReceivedHeaders(CNode& pfrom, const CBlockIndex& last_header, bool received_new_header, bool may_have_more_headers)
670+
EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex);
670671

671672
void SendBlockTransactions(CNode& pfrom, Peer& peer, const CBlock& block, const BlockTransactionsRequest& req);
672673

0 commit comments

Comments
 (0)