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 11, 2024
1 parent d59fd8b commit 50cc2a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/bitcoin-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
if (network_id == UNKNOWN_NETWORK) continue;
m_is_i2p_on |= (network_id == NET_I2P);
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()};
const std::string conn_type{peer["connection_type"].get_str()};
++m_counts.at(is_outbound).at(network_id); // in/out by network
++m_counts.at(is_outbound).at(m_networks_size); // in/out overall
Expand Down

0 comments on commit 50cc2a2

Please sign in to comment.