MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / PrepareRequest

Method PrepareRequest

src/bitcoin-cli.cpp:326–337  ·  view source on GitHub ↗

Create a simulated `getinfo` request. */

Source from the content-addressed store, hash-verified

324
325 /** Create a simulated `getinfo` request. */
326 UniValue PrepareRequest(const std::string& method, const std::vector<std::string>& args) override
327 {
328 if (!args.empty()) {
329 throw std::runtime_error("-getinfo takes no arguments");
330 }
331 UniValue result(UniValue::VARR);
332 result.push_back(JSONRPCRequestObj("getnetworkinfo", NullUniValue, ID_NETWORKINFO));
333 result.push_back(JSONRPCRequestObj("getblockchaininfo", NullUniValue, ID_BLOCKCHAININFO));
334 result.push_back(JSONRPCRequestObj("getwalletinfo", NullUniValue, ID_WALLETINFO));
335 result.push_back(JSONRPCRequestObj("getbalances", NullUniValue, ID_BALANCES));
336 return result;
337 }
338
339 /** Collect values from the batch and form a simulated `getinfo` reply. */
340 UniValue ProcessReply(const UniValue &batch_in) override

Callers 2

CallIPCFunction · 0.45
CallRPCFunction · 0.45

Calls 3

JSONRPCRequestObjFunction · 0.85
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected