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

Method PrepareRequest

src/bitcoin-cli.cpp:275–285  ·  view source on GitHub ↗

Create a simulated `getinfo` request. */

Source from the content-addressed store, hash-verified

273
274 /** Create a simulated `getinfo` request. */
275 UniValue PrepareRequest(const std::string& method, const std::vector<std::string>& args) override
276 {
277 if (!args.empty()) {
278 throw std::runtime_error("-getinfo takes no arguments");
279 }
280 UniValue result(UniValue::VARR);
281 result.push_back(JSONRPCRequestObj("getnetworkinfo", NullUniValue, ID_NETWORKINFO));
282 result.push_back(JSONRPCRequestObj("getblockchaininfo", NullUniValue, ID_BLOCKCHAININFO));
283 result.push_back(JSONRPCRequestObj("getwalletinfo", NullUniValue, ID_WALLETINFO));
284 return result;
285 }
286
287 /** Collect values from the batch and form a simulated `getinfo` reply. */
288 UniValue ProcessReply(const UniValue &batch_in) override

Callers 1

CallRPCFunction · 0.45

Calls 3

JSONRPCRequestObjFunction · 0.85
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected