Changeset View
Changeset View
Standalone View
Standalone View
src/bitcoin-cli.cpp
Show First 20 Lines • Show All 314 Lines • ▼ Show 20 Lines | UniValue PrepareRequest(const std::string &method, | ||||
result.push_back( | result.push_back( | ||||
JSONRPCRequestObj("getbalances", NullUniValue, ID_BALANCES)); | JSONRPCRequestObj("getbalances", NullUniValue, ID_BALANCES)); | ||||
return result; | return result; | ||||
} | } | ||||
/** Collect values from the batch and form a simulated `getinfo` reply. */ | /** Collect values from the batch and form a simulated `getinfo` reply. */ | ||||
UniValue ProcessReply(const UniValue &batch_in) override { | UniValue ProcessReply(const UniValue &batch_in) override { | ||||
UniValue result(UniValue::VOBJ); | UniValue result(UniValue::VOBJ); | ||||
std::vector<UniValue> batch = | const std::vector<UniValue> batch = JSONRPCProcessBatchReply(batch_in); | ||||
JSONRPCProcessBatchReply(batch_in, batch_in.size()); | |||||
// Errors in getnetworkinfo() and getblockchaininfo() are fatal, pass | // Errors in getnetworkinfo() and getblockchaininfo() are fatal, pass | ||||
// them on; getwalletinfo() and getbalances are allowed to fail if there | // them on; getwalletinfo() and getbalances are allowed to fail if there | ||||
// is no wallet. | // is no wallet. | ||||
if (!batch[ID_NETWORKINFO]["error"].isNull()) { | if (!batch[ID_NETWORKINFO]["error"].isNull()) { | ||||
return batch[ID_NETWORKINFO]; | return batch[ID_NETWORKINFO]; | ||||
} | } | ||||
if (!batch[ID_BLOCKCHAININFO]["error"].isNull()) { | if (!batch[ID_BLOCKCHAININFO]["error"].isNull()) { | ||||
return batch[ID_BLOCKCHAININFO]; | return batch[ID_BLOCKCHAININFO]; | ||||
▲ Show 20 Lines • Show All 440 Lines • Show Last 20 Lines |