mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Merge #19910: net processing: Move peer_map to PeerManager
3025ca9e77[net processing] Add RemovePeer() (John Newbery)a20ab22786[net processing] Make GetPeerRef const (John Newbery)ed7e469cee[net_processing] Move peer_map to PeerManager (John Newbery)a529fd3e3f[net processing] Move GetNodeStateStats into PeerManager (John Newbery) Pull request description: This moves `g_peer_map` from a global in net_processing.cpp's unnamed namespace to being a member `m_peer_map` of `PeerManager`. ACKs for top commit: theuni: Re-ACK3025ca9e77. dongcarl: Re-ACK3025ca9hebasto: re-ACK3025ca9e77, since my [previous](https://github.com/bitcoin/bitcoin/pull/19910#pullrequestreview-545574237) review only reverted the change that introduced NRVO in `PeerManager::GetPeerRef`, and comments are fixed in the proper commits. Tree-SHA512: 6369eb3c688ac5b84f89f7674115f78ff02edbed76063ac2ebb1759894c9e973883e10821a35dab92bd3d738280acc095bd5368f552a060b83cd309330387d47
This commit is contained in:
@@ -121,11 +121,13 @@ public:
|
||||
}
|
||||
|
||||
// Try to retrieve the CNodeStateStats for each node.
|
||||
TRY_LOCK(::cs_main, lockMain);
|
||||
if (lockMain) {
|
||||
for (auto& node_stats : stats) {
|
||||
std::get<1>(node_stats) =
|
||||
GetNodeStateStats(std::get<0>(node_stats).nodeid, std::get<2>(node_stats));
|
||||
if (m_context->peerman) {
|
||||
TRY_LOCK(::cs_main, lockMain);
|
||||
if (lockMain) {
|
||||
for (auto& node_stats : stats) {
|
||||
std::get<1>(node_stats) =
|
||||
m_context->peerman->GetNodeStateStats(std::get<0>(node_stats).nodeid, std::get<2>(node_stats));
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user