Skip to content

Commit

Permalink
partial bitcoin#25176: Fix frequent -netinfo JSON errors from null ge…
Browse files Browse the repository at this point in the history
…tpeerinfo#relaytxes

excludes:
- a17c5e9
  • Loading branch information
kwvg committed Apr 26, 2024
1 parent c89799d commit ab7ac1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bitcoin-cli.cpp
Expand Up @@ -525,7 +525,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
const int8_t network_id{NetworkStringToId(network)};
if (network_id == UNKNOWN_NETWORK) continue;
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(m_networks.size()); // in/out overall
++m_counts.at(2).at(network_id); // total by network
Expand Down

0 comments on commit ab7ac1b

Please sign in to comment.