@@ -283,7 +283,7 @@ struct Peer {
283283 };
284284
285285 /* Initializes a TxRelay struct for this peer. Can be called at most once for a peer. */
286- TxRelay* SetTxRelay ()
286+ TxRelay* SetTxRelay () EXCLUSIVE_LOCKS_REQUIRED(!m_tx_relay_mutex)
287287 {
288288 LOCK (m_tx_relay_mutex);
289289 Assume (!m_tx_relay);
@@ -472,15 +472,16 @@ class PeerManagerImpl final : public PeerManager
472472 EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
473473 void BlockChecked (const CBlock& block, const BlockValidationState& state) override
474474 EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
475- void NewPoWValidBlock (const CBlockIndex *pindex, const std::shared_ptr<const CBlock>& pblock) override ;
475+ void NewPoWValidBlock (const CBlockIndex *pindex, const std::shared_ptr<const CBlock>& pblock) override
476+ EXCLUSIVE_LOCKS_REQUIRED(!m_most_recent_block_mutex);
476477
477478 /* * Implement NetEventsInterface */
478479 void InitializeNode (CNode* pnode) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
479480 void FinalizeNode (const CNode& node) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
480481 bool ProcessMessages (CNode* pfrom, std::atomic<bool >& interrupt) override
481- EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, !m_recent_confirmed_transactions_mutex);
482+ EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, !m_recent_confirmed_transactions_mutex, !m_most_recent_block_mutex );
482483 bool SendMessages (CNode* pto) override EXCLUSIVE_LOCKS_REQUIRED(pto->cs_sendProcessing)
483- EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, !m_recent_confirmed_transactions_mutex);
484+ EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, !m_recent_confirmed_transactions_mutex, !m_most_recent_block_mutex );
484485
485486 /* * Implement PeerManager */
486487 void StartScheduledTasks (CScheduler& scheduler) override ;
@@ -494,7 +495,7 @@ class PeerManagerImpl final : public PeerManager
494495 void Misbehaving (const NodeId pnode, const int howmuch, const std::string& message) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
495496 void ProcessMessage (CNode& pfrom, const std::string& msg_type, CDataStream& vRecv,
496497 const std::chrono::microseconds time_received, const std::atomic<bool >& interruptMsgProc) override
497- EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, !m_recent_confirmed_transactions_mutex);
498+ EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex, !m_recent_confirmed_transactions_mutex, !m_most_recent_block_mutex );
498499 void UpdateLastBlockAnnounceTime (NodeId node, int64_t time_in_seconds) override ;
499500
500501private:
@@ -758,7 +759,8 @@ class PeerManagerImpl final : public PeerManager
758759 /* * Determine whether or not a peer can request a transaction, and return it (or nullptr if not found or not allowed). */
759760 CTransactionRef FindTxForGetData (const CNode& peer, const GenTxid& gtxid, const std::chrono::seconds mempool_req, const std::chrono::seconds now) LOCKS_EXCLUDED(cs_main);
760761
761- void ProcessGetData (CNode& pfrom, Peer& peer, const std::atomic<bool >& interruptMsgProc) EXCLUSIVE_LOCKS_REQUIRED(peer.m_getdata_requests_mutex) LOCKS_EXCLUDED(::cs_main);
762+ void ProcessGetData (CNode& pfrom, Peer& peer, const std::atomic<bool >& interruptMsgProc)
763+ EXCLUSIVE_LOCKS_REQUIRED(!m_most_recent_block_mutex, peer.m_getdata_requests_mutex) LOCKS_EXCLUDED(::cs_main);
762764
763765 /* * Process a new block. Perform any post-processing housekeeping */
764766 void ProcessBlock (CNode& node, const std::shared_ptr<const CBlock>& block, bool force_processing);
@@ -809,7 +811,8 @@ class PeerManagerImpl final : public PeerManager
809811 */
810812 bool BlockRequestAllowed (const CBlockIndex* pindex) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
811813 bool AlreadyHaveBlock (const uint256& block_hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
812- void ProcessGetBlockData (CNode& pfrom, Peer& peer, const CInv& inv);
814+ void ProcessGetBlockData (CNode& pfrom, Peer& peer, const CInv& inv)
815+ EXCLUSIVE_LOCKS_REQUIRED(!m_most_recent_block_mutex);
813816
814817 /* *
815818 * Validation logic for compact filters request handling.
0 commit comments