@@ -259,6 +259,14 @@ static void http_error_cb(enum evhttp_request_error err, void *ctx)
259
259
reply->error = err;
260
260
}
261
261
262
+ static int8_t NetworkStringToId (const std::string& str)
263
+ {
264
+ for (size_t i = 0 ; i < NETWORKS.size (); ++i) {
265
+ if (str == NETWORKS[i]) return i;
266
+ }
267
+ return UNKNOWN_NETWORK;
268
+ }
269
+
262
270
/* * Class that handles the conversion from a command-line to a JSON-RPC request,
263
271
* as well as converting back to a JSON object that can be shown as result.
264
272
*/
@@ -273,15 +281,6 @@ class BaseRequestHandler
273
281
/* * Process addrinfo requests */
274
282
class AddrinfoRequestHandler : public BaseRequestHandler
275
283
{
276
- private:
277
- int8_t NetworkStringToId (const std::string& str) const
278
- {
279
- for (size_t i = 0 ; i < NETWORKS.size (); ++i) {
280
- if (str == NETWORKS[i]) return i;
281
- }
282
- return UNKNOWN_NETWORK;
283
- }
284
-
285
284
public:
286
285
UniValue PrepareRequest (const std::string& method, const std::vector<std::string>& args) override
287
286
{
@@ -396,13 +395,6 @@ class NetinfoRequestHandler : public BaseRequestHandler
396
395
std::array<std::array<uint16_t , NETWORKS.size() + 1 >, 3 > m_counts{{{}}}; // !< Peer counts by (in/out/total, networks/total)
397
396
uint8_t m_block_relay_peers_count{0 };
398
397
uint8_t m_manual_peers_count{0 };
399
- int8_t NetworkStringToId (const std::string& str) const
400
- {
401
- for (size_t i = 0 ; i < NETWORKS.size (); ++i) {
402
- if (str == NETWORKS[i]) return i;
403
- }
404
- return UNKNOWN_NETWORK;
405
- }
406
398
uint8_t m_details_level{0 }; // !< Optional user-supplied arg to set dashboard details level
407
399
bool DetailsRequested () const { return m_details_level; }
408
400
bool IsAddressSelected () const { return m_details_level == 2 || m_details_level == 4 ; }
0 commit comments