| 444 | static constexpr int ID_NETWORKINFO = 1; |
| 445 | |
| 446 | UniValue PrepareRequest(const std::string& method, const std::vector<std::string>& args) override |
| 447 | { |
| 448 | if (!args.empty()) { |
| 449 | uint8_t n{0}; |
| 450 | if (ParseUInt8(args.at(0), &n)) { |
| 451 | m_details_level = std::min(n, MAX_DETAIL_LEVEL); |
| 452 | } else { |
| 453 | throw std::runtime_error(strprintf("invalid -netinfo argument: %s\nFor more information, run: bitcoin-cli -netinfo help", args.at(0))); |
| 454 | } |
| 455 | } |
| 456 | UniValue result(UniValue::VARR); |
| 457 | result.push_back(JSONRPCRequestObj("getpeerinfo", NullUniValue, ID_PEERINFO)); |
| 458 | result.push_back(JSONRPCRequestObj("getnetworkinfo", NullUniValue, ID_NETWORKINFO)); |
| 459 | return result; |
| 460 | } |
| 461 | |
| 462 | UniValue ProcessReply(const UniValue& batch_in) override |
| 463 | { |
nothing calls this directly
no test coverage detected