File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -256,9 +256,14 @@ class AddrinfoRequestHandler : public BaseRequestHandler
256
256
257
257
UniValue ProcessReply (const UniValue& reply) override
258
258
{
259
+ if (!reply[" error" ].isNull ()) return reply;
260
+ const std::vector<UniValue>& nodes{reply[" result" ].getValues ()};
261
+ if (!nodes.empty () && nodes.at (0 )[" network" ].isNull ()) {
262
+ throw std::runtime_error (" -addrinfo requires bitcoind server to be running v22.0 and up" );
263
+ }
259
264
// Count the number of peers we know by network, including torv2 versus torv3.
260
265
std::array<uint64_t , m_networks_size> counts{{}};
261
- for (const UniValue& node : reply[ " result " ]. getValues () ) {
266
+ for (const UniValue& node : nodes ) {
262
267
std::string network_name{node[" network" ].get_str ()};
263
268
if (network_name == " onion" ) {
264
269
network_name = node[" address" ].get_str ().size () > 22 ? " torv3" : " torv2" ;
You can’t perform that action at this time.
0 commit comments