Skip to content

Commit cd087fc

Browse files
committed
fix: bring back missing lock annotations
1 parent 7b271b8 commit cd087fc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/net_processing.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ static void UpdatePreferredDownload(const CNode& node, CNodeState* state) EXCLUS
635635
nPreferredDownload += state->fPreferredDownload;
636636
}
637637

638-
bool PeerManagerImpl::MarkBlockAsReceived(const uint256& hash)
638+
bool PeerManagerImpl::MarkBlockAsReceived(const uint256& hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
639639
{
640640
std::map<uint256, std::pair<NodeId, std::list<QueuedBlock>::iterator> >::iterator itInFlight = mapBlocksInFlight.find(hash);
641641
if (itInFlight != mapBlocksInFlight.end()) {
@@ -659,7 +659,7 @@ bool PeerManagerImpl::MarkBlockAsReceived(const uint256& hash)
659659
return false;
660660
}
661661

662-
bool PeerManagerImpl::MarkBlockAsInFlight(NodeId nodeid, const uint256& hash, const CBlockIndex *pindex, std::list<QueuedBlock>::iterator **pit)
662+
bool PeerManagerImpl::MarkBlockAsInFlight(NodeId nodeid, const uint256& hash, const CBlockIndex *pindex, std::list<QueuedBlock>::iterator **pit) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
663663
{
664664
CNodeState *state = State(nodeid);
665665
assert(state != nullptr);
@@ -728,7 +728,7 @@ static void UpdateBlockAvailability(NodeId nodeid, const uint256 &hash) EXCLUSIV
728728
}
729729
}
730730

731-
void PeerManagerImpl::MaybeSetPeerAsAnnouncingHeaderAndIDs(NodeId nodeid)
731+
void PeerManagerImpl::MaybeSetPeerAsAnnouncingHeaderAndIDs(NodeId nodeid) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
732732
{
733733
AssertLockHeld(cs_main);
734734
CNodeState* nodestate = State(nodeid);
@@ -764,7 +764,7 @@ void PeerManagerImpl::MaybeSetPeerAsAnnouncingHeaderAndIDs(NodeId nodeid)
764764
}
765765
}
766766

767-
bool PeerManagerImpl::TipMayBeStale()
767+
bool PeerManagerImpl::TipMayBeStale() EXCLUSIVE_LOCKS_REQUIRED(cs_main)
768768
{
769769
AssertLockHeld(cs_main);
770770
const Consensus::Params& consensusParams = m_chainparams.GetConsensus();
@@ -788,7 +788,7 @@ static bool PeerHasHeader(CNodeState *state, const CBlockIndex *pindex) EXCLUSIV
788788
return false;
789789
}
790790

791-
void PeerManagerImpl::FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vector<const CBlockIndex*>& vBlocks, NodeId& nodeStaller)
791+
void PeerManagerImpl::FindNextBlocksToDownload(NodeId nodeid, unsigned int count, std::vector<const CBlockIndex*>& vBlocks, NodeId& nodeStaller) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
792792
{
793793
if (count == 0)
794794
return;
@@ -1709,7 +1709,7 @@ void PeerManagerImpl::BlockChecked(const CBlock& block, const BlockValidationSta
17091709
//
17101710

17111711

1712-
bool PeerManagerImpl::AlreadyHave(const CInv& inv)
1712+
bool PeerManagerImpl::AlreadyHave(const CInv& inv) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
17131713
{
17141714
switch (inv.type)
17151715
{
@@ -1993,7 +1993,7 @@ void static ProcessGetBlockData(CNode& pfrom, const CChainParams& chainparams, c
19931993
}
19941994
}
19951995

1996-
void PeerManagerImpl::ProcessGetData(CNode& pfrom, Peer& peer, const std::atomic<bool>& interruptMsgProc)
1996+
void PeerManagerImpl::ProcessGetData(CNode& pfrom, Peer& peer, const std::atomic<bool>& interruptMsgProc) LOCKS_EXCLUDED(cs_main) EXCLUSIVE_LOCKS_REQUIRED(peer.m_getdata_requests_mutex)
19971997
{
19981998
AssertLockNotHeld(cs_main);
19991999

0 commit comments

Comments
 (0)