refactor: remove extraneous lock annotations from function definitions

These annotations belong in the declarations rather than the definitions.
While harmless now, future versions of clang may warn about these.
This commit is contained in:
Cory Fields
2024-06-20 18:43:38 +00:00
parent a961ad1beb
commit 5729dbbb74
5 changed files with 6 additions and 7 deletions

View File

@@ -1164,7 +1164,7 @@ private:
void PushAddress(Peer& peer, const CAddress& addr) EXCLUSIVE_LOCKS_REQUIRED(g_msgproc_mutex);
};
const CNodeState* PeerManagerImpl::State(NodeId pnode) const EXCLUSIVE_LOCKS_REQUIRED(cs_main)
const CNodeState* PeerManagerImpl::State(NodeId pnode) const
{
std::map<NodeId, CNodeState>::const_iterator it = m_node_states.find(pnode);
if (it == m_node_states.end())
@@ -1172,7 +1172,7 @@ const CNodeState* PeerManagerImpl::State(NodeId pnode) const EXCLUSIVE_LOCKS_REQ
return &it->second;
}
CNodeState* PeerManagerImpl::State(NodeId pnode) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
CNodeState* PeerManagerImpl::State(NodeId pnode)
{
return const_cast<CNodeState*>(std::as_const(*this).State(pnode));
}