MCPcopy Create free account
hub / github.com/ElementsProject/elements / PrepareRequest

Method PrepareRequest

src/bitcoin-cli.cpp:446–460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 4

ParseUInt8Function · 0.85
JSONRPCRequestObjFunction · 0.85
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected