Merge 795afe6e63 into merged_master (Bitcoin PR #19910)

This commit is contained in:
Andrew Poelstra 2021-06-13 16:49:44 +00:00
commit 8e1945ddc2
4 changed files with 94 additions and 74 deletions

View file

@ -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;