Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/misc.cpp
Show All 14 Lines | |||||
#include <outputtype.h> | #include <outputtype.h> | ||||
#include <rpc/blockchain.h> | #include <rpc/blockchain.h> | ||||
#include <rpc/server.h> | #include <rpc/server.h> | ||||
#include <rpc/util.h> | #include <rpc/util.h> | ||||
#include <timedata.h> | #include <timedata.h> | ||||
#include <util/strencodings.h> | #include <util/strencodings.h> | ||||
#include <util/system.h> | #include <util/system.h> | ||||
#include <validation.h> | #include <validation.h> | ||||
#ifdef ENABLE_WALLET | |||||
#include <wallet/rpcwallet.h> | |||||
#include <wallet/wallet.h> | |||||
#include <wallet/walletdb.h> | |||||
#endif | |||||
#include <warnings.h> | #include <warnings.h> | ||||
#include <univalue.h> | #include <univalue.h> | ||||
#include <cstdint> | #include <cstdint> | ||||
#ifdef HAVE_MALLOC_INFO | #ifdef HAVE_MALLOC_INFO | ||||
#include <malloc.h> | #include <malloc.h> | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | if (isValid) { | ||||
UniValue detail = DescribeAddress(dest); | UniValue detail = DescribeAddress(dest); | ||||
ret.pushKVs(detail); | ret.pushKVs(detail); | ||||
} | } | ||||
} | } | ||||
return ret; | return ret; | ||||
} | } | ||||
// Needed even with !ENABLE_WALLET, to pass (ignored) pointers around | |||||
class CWallet; | |||||
static UniValue createmultisig(const Config &config, | static UniValue createmultisig(const Config &config, | ||||
const JSONRPCRequest &request) { | const JSONRPCRequest &request) { | ||||
if (request.fHelp || request.params.size() < 2 || | if (request.fHelp || request.params.size() < 2 || | ||||
request.params.size() > 2) { | request.params.size() > 2) { | ||||
std::string msg = | std::string msg = | ||||
"createmultisig nrequired [\"key\",...]\n" | "createmultisig nrequired [\"key\",...]\n" | ||||
"\nCreates a multi-signature address with n signature of m keys " | "\nCreates a multi-signature address with n signature of m keys " | ||||
"required.\n" | "required.\n" | ||||
▲ Show 20 Lines • Show All 438 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
// clang-format off | // clang-format off | ||||
static const ContextFreeRPCCommand commands[] = { | static const ContextFreeRPCCommand commands[] = { | ||||
// category name actor (function) argNames | // category name actor (function) argNames | ||||
// ------------------- ------------------------ ---------------------- ---------- | // ------------------- ------------------------ ---------------------- ---------- | ||||
{ "control", "getmemoryinfo", getmemoryinfo, {"mode"} }, | { "control", "getmemoryinfo", getmemoryinfo, {"mode"} }, | ||||
{ "control", "logging", logging, {"include", "exclude"} }, | { "control", "logging", logging, {"include", "exclude"} }, | ||||
{ "util", "validateaddress", validateaddress, {"address"} }, /* uses wallet if enabled */ | { "util", "validateaddress", validateaddress, {"address"} }, | ||||
{ "util", "createmultisig", createmultisig, {"nrequired","keys"} }, | { "util", "createmultisig", createmultisig, {"nrequired","keys"} }, | ||||
{ "util", "verifymessage", verifymessage, {"address","signature","message"} }, | { "util", "verifymessage", verifymessage, {"address","signature","message"} }, | ||||
{ "util", "signmessagewithprivkey", signmessagewithprivkey, {"privkey","message"} }, | { "util", "signmessagewithprivkey", signmessagewithprivkey, {"privkey","message"} }, | ||||
/* Not shown in help */ | /* Not shown in help */ | ||||
{ "hidden", "setmocktime", setmocktime, {"timestamp"}}, | { "hidden", "setmocktime", setmocktime, {"timestamp"}}, | ||||
{ "hidden", "echo", echo, {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}}, | { "hidden", "echo", echo, {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}}, | ||||
{ "hidden", "echojson", echo, {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}}, | { "hidden", "echojson", echo, {"arg0","arg1","arg2","arg3","arg4","arg5","arg6","arg7","arg8","arg9"}}, | ||||
{ "hidden", "getinfo", getinfo_deprecated, {}}, | { "hidden", "getinfo", getinfo_deprecated, {}}, | ||||
}; | }; | ||||
// clang-format on | // clang-format on | ||||
void RegisterMiscRPCCommands(CRPCTable &t) { | void RegisterMiscRPCCommands(CRPCTable &t) { | ||||
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++) { | for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++) { | ||||
t.appendCommand(commands[vcidx].name, &commands[vcidx]); | t.appendCommand(commands[vcidx].name, &commands[vcidx]); | ||||
} | } | ||||
} | } |