diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 4b2f6e8461fa8..9ad44928a000e 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -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