mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
[net processing] Make GetPeerRef const
This commit is contained in:
@@ -835,7 +835,7 @@ void PeerManager::FinalizeNode(const CNode& node, bool& fUpdateConnectionTime) {
|
|||||||
LogPrint(BCLog::NET, "Cleared nodestate for peer=%d\n", nodeid);
|
LogPrint(BCLog::NET, "Cleared nodestate for peer=%d\n", nodeid);
|
||||||
}
|
}
|
||||||
|
|
||||||
PeerRef PeerManager::GetPeerRef(NodeId id)
|
PeerRef PeerManager::GetPeerRef(NodeId id) const
|
||||||
{
|
{
|
||||||
LOCK(m_peer_mutex);
|
LOCK(m_peer_mutex);
|
||||||
auto it = m_peer_map.find(id);
|
auto it = m_peer_map.find(id);
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
/** Get a shared pointer to the Peer object.
|
/** Get a shared pointer to the Peer object.
|
||||||
* May return an empty shared_ptr if the Peer object can't be found. */
|
* May return an empty shared_ptr if the Peer object can't be found. */
|
||||||
PeerRef GetPeerRef(NodeId id);
|
PeerRef GetPeerRef(NodeId id) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Potentially mark a node discouraged based on the contents of a BlockValidationState object
|
* Potentially mark a node discouraged based on the contents of a BlockValidationState object
|
||||||
@@ -193,7 +193,7 @@ private:
|
|||||||
int64_t m_stale_tip_check_time; //!< Next time to check for stale tip
|
int64_t m_stale_tip_check_time; //!< Next time to check for stale tip
|
||||||
|
|
||||||
/** Protects m_peer_map */
|
/** Protects m_peer_map */
|
||||||
Mutex m_peer_mutex;
|
mutable Mutex m_peer_mutex;
|
||||||
/**
|
/**
|
||||||
* Map of all Peer objects, keyed by peer id. This map is protected
|
* Map of all Peer objects, keyed by peer id. This map is protected
|
||||||
* by the m_peer_mutex. Once a shared pointer reference is
|
* by the m_peer_mutex. Once a shared pointer reference is
|
||||||
|
|||||||
Reference in New Issue
Block a user