From ab7ac1b85bac8990bc02ef753dc85fe9f2260589 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Fri, 20 May 2022 14:22:07 +0200 Subject: [PATCH] partial bitcoin#25176: Fix frequent -netinfo JSON errors from null getpeerinfo#relaytxes excludes: - a17c5e96b602fed65166037b78d98605e915206b --- src/bitcoin-cli.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 4b2f6e8461..9ad44928a0 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -525,7 +525,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()}; ++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