@@ -283,7 +283,7 @@ struct Peer {
283
283
};
284
284
285
285
/* 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)
287
287
{
288
288
LOCK (m_tx_relay_mutex);
289
289
Assume (!m_tx_relay);
@@ -472,15 +472,16 @@ class PeerManagerImpl final : public PeerManager
472
472
EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
473
473
void BlockChecked (const CBlock& block, const BlockValidationState& state) override
474
474
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);
476
477
477
478
/* * Implement NetEventsInterface */
478
479
void InitializeNode (CNode* pnode) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
479
480
void FinalizeNode (const CNode& node) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
480
481
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 );
482
483
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 );
484
485
485
486
/* * Implement PeerManager */
486
487
void StartScheduledTasks (CScheduler& scheduler) override ;
@@ -494,7 +495,7 @@ class PeerManagerImpl final : public PeerManager
494
495
void Misbehaving (const NodeId pnode, const int howmuch, const std::string& message) override EXCLUSIVE_LOCKS_REQUIRED(!m_peer_mutex);
495
496
void ProcessMessage (CNode& pfrom, const std::string& msg_type, CDataStream& vRecv,
496
497
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 );
498
499
void UpdateLastBlockAnnounceTime (NodeId node, int64_t time_in_seconds) override ;
499
500
500
501
private:
@@ -758,7 +759,8 @@ class PeerManagerImpl final : public PeerManager
758
759
/* * Determine whether or not a peer can request a transaction, and return it (or nullptr if not found or not allowed). */
759
760
CTransactionRef FindTxForGetData (const CNode& peer, const GenTxid& gtxid, const std::chrono::seconds mempool_req, const std::chrono::seconds now) LOCKS_EXCLUDED(cs_main);
760
761
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);
762
764
763
765
/* * Process a new block. Perform any post-processing housekeeping */
764
766
void ProcessBlock (CNode& node, const std::shared_ptr<const CBlock>& block, bool force_processing);
@@ -809,7 +811,8 @@ class PeerManagerImpl final : public PeerManager
809
811
*/
810
812
bool BlockRequestAllowed (const CBlockIndex* pindex) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
811
813
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);
813
816
814
817
/* *
815
818
* Validation logic for compact filters request handling.
0 commit comments