Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcdump.cpp
Show All 18 Lines | |||||
#include <cstdint> | #include <cstdint> | ||||
#include <fstream> | #include <fstream> | ||||
#include <boost/algorithm/string.hpp> | #include <boost/algorithm/string.hpp> | ||||
#include <boost/date_time/posix_time/posix_time.hpp> | #include <boost/date_time/posix_time/posix_time.hpp> | ||||
#include <univalue.h> | #include <univalue.h> | ||||
#include <boost/assign/list_of.hpp> | |||||
void EnsureWalletIsUnlocked(); | void EnsureWalletIsUnlocked(); | ||||
bool EnsureWalletIsAvailable(bool avoidException); | bool EnsureWalletIsAvailable(bool avoidException); | ||||
static std::string EncodeDumpTime(int64_t nTime) { | static std::string EncodeDumpTime(int64_t nTime) { | ||||
return DateTimeStrFormat("%Y-%m-%dT%H:%M:%SZ", nTime); | return DateTimeStrFormat("%Y-%m-%dT%H:%M:%SZ", nTime); | ||||
} | } | ||||
static int64_t DecodeDumpTime(const std::string &str) { | static int64_t DecodeDumpTime(const std::string &str) { | ||||
▲ Show 20 Lines • Show All 1,083 Lines • ▼ Show 20 Lines | if (mainRequest.fHelp || mainRequest.params.size() < 1 || mainRequest.params.size() > 2) | ||||
"\nResponse is an array with the same size as the input that has the execution result :\n" | "\nResponse is an array with the same size as the input that has the execution result :\n" | ||||
" [{ \"success\": true } , { \"success\": false, \"error\": { \"code\": -1, \"message\": \"Internal Server Error\"} }, ... ]\n"); | " [{ \"success\": true } , { \"success\": false, \"error\": { \"code\": -1, \"message\": \"Internal Server Error\"} }, ... ]\n"); | ||||
// clang-format on | // clang-format on | ||||
if (!EnsureWalletIsAvailable(mainRequest.fHelp)) { | if (!EnsureWalletIsAvailable(mainRequest.fHelp)) { | ||||
return NullUniValue; | return NullUniValue; | ||||
} | } | ||||
RPCTypeCheck(mainRequest.params, | RPCTypeCheck(mainRequest.params, {UniValue::VARR, UniValue::VOBJ}); | ||||
boost::assign::list_of(UniValue::VARR)(UniValue::VOBJ)); | |||||
const UniValue &requests = mainRequest.params[0]; | const UniValue &requests = mainRequest.params[0]; | ||||
// Default options | // Default options | ||||
bool fRescan = true; | bool fRescan = true; | ||||
if (mainRequest.params.size() > 1) { | if (mainRequest.params.size() > 1) { | ||||
const UniValue &options = mainRequest.params[1]; | const UniValue &options = mainRequest.params[1]; | ||||
▲ Show 20 Lines • Show All 117 Lines • Show Last 20 Lines |