mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 02:25:40 +01:00
Fix frequent -netinfo JSON errors from null getpeerinfo#relaytxes
"error: JSON value is not a boolean as expected" due to fRelayTxes/m_relay_txs being moved in PR 21160 from CNodeStats to CNodeStateStats, which made getpeerinfo#relaytxes an optional field that can return UniValue IsNull().
This commit is contained in:
parent
0cd1a2eff9
commit
f0bb7db34c
@ -477,7 +477,7 @@ public:
|
||||
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()};
|
||||
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(NETWORKS.size()); // in/out overall
|
||||
|
Loading…
Reference in New Issue
Block a user