diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-03-29 19:43:02 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-03-31 10:48:32 +0200 |
| commit | fb8a8cf2e610920e9eee61c19ed6080af064bb43 (patch) | |
| tree | 982b45be4ded75a296f459b78b38b38ccfe0594a /src/rpc/misc.cpp | |
| parent | Merge #7723: build: python 3 compatibility (diff) | |
| download | discoin-fb8a8cf2e610920e9eee61c19ed6080af064bb43.tar.xz discoin-fb8a8cf2e610920e9eee61c19ed6080af064bb43.zip | |
rpc: Register calls where they are defined
Split out methods to every module, apart from 'help' and 'stop' which
are implemented in rpcserver.cpp itself.
- This makes it easier to add or remove RPC commands - no longer everything that includes
rpcserver.h has to be rebuilt when there's a change there.
- Cleans up `rpc/server.h` by getting rid of the huge cluttered list of function definitions.
- Removes most of the bitcoin-specific code from rpcserver.cpp and .h.
Continues #7307 for the non-wallet.
Diffstat (limited to 'src/rpc/misc.cpp')
| -rw-r--r-- | src/rpc/misc.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp index 0aab9c304..e8a099b44 100644 --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -396,3 +396,21 @@ 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 }, + + /* 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]); +} |