Skip to content

Commit ab7ac1b

Browse files
committed
partial bitcoin#25176: Fix frequent -netinfo JSON errors from null getpeerinfo#relaytxes
excludes: - a17c5e9
1 parent c89799d commit ab7ac1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bitcoin-cli.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
525525
const int8_t network_id{NetworkStringToId(network)};
526526
if (network_id == UNKNOWN_NETWORK) continue;
527527
const bool is_outbound{!peer["inbound"].get_bool()};
528-
const bool is_block_relay{!peer["relaytxes"].get_bool()};
528+
const bool is_block_relay{peer["relaytxes"].isNull() ? false : !peer["relaytxes"].get_bool()};
529529
++m_counts.at(is_outbound).at(network_id); // in/out by network
530530
++m_counts.at(is_outbound).at(m_networks.size()); // in/out overall
531531
++m_counts.at(2).at(network_id); // total by network

0 commit comments

Comments
 (0)