From ff53759be835694f18db0f743acc0e99000f5fcb Mon Sep 17 00:00:00 2001 From: lateminer Date: Sat, 6 Jan 2018 14:19:30 +0300 Subject: [PATCH] Fix: rpc: Register calls where they are defined --- src/rpc/misc.cpp | 52 ++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 3d7f66459..8fa723e54 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -413,32 +413,6 @@ UniValue setmocktime(const UniValue& params, bool fHelp) return NullUniValue; } -static const CRPCCommand commands[] = -{ // category name actor (function) okSafeMode - // --------------------- ------------------------ ----------------------- ---------- - { "control", "getinfo", &getinfo, true }, /* uses wallet if enabled */ - { "util", "validateaddress", &validateaddress, true }, /* uses wallet if enabled */ - { "util", "createmultisig", &createmultisig, true }, - { "util", "verifymessage", &verifymessage, true }, - { "util", "getspentinfo", &getspentinfo, false }, - - /* Address index */ - { "addressindex", "getaddressmempool", &getaddressmempool, true }, - { "addressindex", "getaddressutxos", &getaddressutxos, false }, - { "addressindex", "getaddressdeltas", &getaddressdeltas, false }, - { "addressindex", "getaddresstxids", &getaddresstxids, false }, - { "addressindex", "getaddressbalance", &getaddressbalance, false }, - - /* Not shown in help */ - { "hidden", "setmocktime", &setmocktime, true }, -}; - -void RegisterMiscRPCCommands(CRPCTable &tableRPC) -{ - for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++) - tableRPC.appendCommand(commands[vcidx].name, &commands[vcidx]); -} - bool getAddressFromIndex(const int &type, const uint160 &hash, std::string &address) { if (type == 2) { @@ -966,3 +940,29 @@ UniValue getspentinfo(const UniValue& params, bool fHelp) return obj; } + +static const CRPCCommand commands[] = +{ // category name actor (function) okSafeMode + // --------------------- ------------------------ ----------------------- ---------- + { "control", "getinfo", &getinfo, true }, /* uses wallet if enabled */ + { "util", "validateaddress", &validateaddress, true }, /* uses wallet if enabled */ + { "util", "createmultisig", &createmultisig, true }, + { "util", "verifymessage", &verifymessage, true }, + { "util", "getspentinfo", &getspentinfo, false }, + + /* Address index */ + { "addressindex", "getaddressmempool", &getaddressmempool, true }, + { "addressindex", "getaddressutxos", &getaddressutxos, false }, + { "addressindex", "getaddressdeltas", &getaddressdeltas, false }, + { "addressindex", "getaddresstxids", &getaddresstxids, false }, + { "addressindex", "getaddressbalance", &getaddressbalance, false }, + + /* Not shown in help */ + { "hidden", "setmocktime", &setmocktime, true }, +}; + +void RegisterMiscRPCCommands(CRPCTable &tableRPC) +{ + for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++) + tableRPC.appendCommand(commands[vcidx].name, &commands[vcidx]); +}