From 5f80d8d1eec14253407ceed1a813619d3e5a0fe4 Mon Sep 17 00:00:00 2001 From: dergoegge Date: Tue, 20 Sep 2022 12:35:16 +0100 Subject: [PATCH] [net processing] Annotate nUnconnectingHeaders as guarded by g_msgproc_mutex --- src/net_processing.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/net_processing.cpp b/src/net_processing.cpp index d224cae58a6..14eac13aa4d 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -415,7 +415,7 @@ struct CNodeState { //! The best header we have sent our peer. const CBlockIndex* pindexBestHeaderSent{nullptr}; //! Length of current-streak of unconnecting headers announcements - int nUnconnectingHeaders{0}; + int nUnconnectingHeaders GUARDED_BY(NetEventsInterface::g_msgproc_mutex){0}; //! Whether we've started headers synchronization with this peer. bool fSyncStarted{false}; //! When to potentially disconnect peer for stalling headers download @@ -666,7 +666,8 @@ private: /** Potentially fetch blocks from this peer upon receipt of a new headers tip */ void HeadersDirectFetchBlocks(CNode& pfrom, const Peer& peer, const CBlockIndex& last_header); /** Update peer state based on received headers message */ - void UpdatePeerStateForReceivedHeaders(CNode& pfrom, const CBlockIndex& last_header, bool received_new_header, bool may_have_more_headers); + void UpdatePeerStateForReceivedHeaders(CNode& pfrom, const CBlockIndex& last_header, bool received_new_header, bool may_have_more_headers) + EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex); void SendBlockTransactions(CNode& pfrom, Peer& peer, const CBlock& block, const BlockTransactionsRequest& req);