partial bitcoin#25176: Fix frequent -netinfo JSON errors from null getpeerinfo#relaytxes

excludes:
- a17c5e96b602fed65166037b78d98605e915206b
This commit is contained in:
Kittywhiskers Van Gogh 2022-05-20 14:22:07 +02:00
parent c89799d46c
commit ab7ac1b85b
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD

View File

@ -525,7 +525,7 @@ public:
const int8_t network_id{NetworkStringToId(network)}; const int8_t network_id{NetworkStringToId(network)};
if (network_id == UNKNOWN_NETWORK) continue; if (network_id == UNKNOWN_NETWORK) continue;
const bool is_outbound{!peer["inbound"].get_bool()}; const bool is_outbound{!peer["inbound"].get_bool()};
const bool is_block_relay{!peer["relaytxes"].get_bool()}; const bool is_block_relay{peer["relaytxes"].isNull() ? false : !peer["relaytxes"].get_bool()};
++m_counts.at(is_outbound).at(network_id); // in/out by network ++m_counts.at(is_outbound).at(network_id); // in/out by network
++m_counts.at(is_outbound).at(m_networks.size()); // in/out overall ++m_counts.at(is_outbound).at(m_networks.size()); // in/out overall
++m_counts.at(2).at(network_id); // total by network ++m_counts.at(2).at(network_id); // total by network