Browse Source

Organize RPCCommands table

Use sensible categories (overall control, P2P, blockchain/UTXO and
mining, wallet, wallet-enabled mining) and sort within each.

Also remove unnecessary #ifdef ENABLE_WALLET from `rpcnet.cpp`.

Functionality-neutral change.
0.10
Wladimir J. van der Laan 11 years ago
parent
commit
ab88ed93ef
  1. 4
      src/rpcnet.cpp
  2. 103
      src/rpcserver.cpp

4
src/rpcnet.cpp

@ -10,10 +10,6 @@
#include "protocol.h" #include "protocol.h"
#include "sync.h" #include "sync.h"
#include "util.h" #include "util.h"
#ifdef ENABLE_WALLET
#include "init.h" // for getinfo
#include "wallet.h" // for getinfo
#endif
#include <boost/foreach.hpp> #include <boost/foreach.hpp>
#include "json/json_spirit_value.h" #include "json/json_spirit_value.h"

103
src/rpcserver.cpp

@ -222,86 +222,95 @@ Value stop(const Array& params, bool fHelp)
static const CRPCCommand vRPCCommands[] = static const CRPCCommand vRPCCommands[] =
{ // name actor (function) okSafeMode threadSafe reqWallet { // name actor (function) okSafeMode threadSafe reqWallet
// ------------------------ ----------------------- ---------- ---------- --------- // ------------------------ ----------------------- ---------- ---------- ---------
/* Overall control/query calls */
{ "getinfo", &getinfo, true, false, false }, /* uses wallet if enabled */
{ "help", &help, true, true, false }, { "help", &help, true, true, false },
{ "stop", &stop, true, true, false }, { "stop", &stop, true, true, false },
{ "getblockcount", &getblockcount, true, false, false },
{ "getbestblockhash", &getbestblockhash, true, false, false }, /* P2P networking */
{ "getconnectioncount", &getconnectioncount, true, false, false },
{ "getpeerinfo", &getpeerinfo, true, false, false },
{ "ping", &ping, true, false, false },
{ "addnode", &addnode, true, true, false }, { "addnode", &addnode, true, true, false },
{ "getaddednodeinfo", &getaddednodeinfo, true, true, false }, { "getaddednodeinfo", &getaddednodeinfo, true, true, false },
{ "getconnectioncount", &getconnectioncount, true, false, false },
{ "getnettotals", &getnettotals, true, true, false }, { "getnettotals", &getnettotals, true, true, false },
{ "getdifficulty", &getdifficulty, true, false, false }, { "getpeerinfo", &getpeerinfo, true, false, false },
{ "getinfo", &getinfo, true, false, false }, { "ping", &ping, true, false, false },
{ "getrawmempool", &getrawmempool, true, false, false },
/* Block chain and UTXO */
{ "getbestblockhash", &getbestblockhash, true, false, false },
{ "getblockcount", &getblockcount, true, false, false },
{ "getblock", &getblock, false, false, false }, { "getblock", &getblock, false, false, false },
{ "getblockhash", &getblockhash, false, false, false }, { "getblockhash", &getblockhash, false, false, false },
{ "getrawtransaction", &getrawtransaction, false, false, false }, { "getdifficulty", &getdifficulty, true, false, false },
{ "createrawtransaction", &createrawtransaction, false, false, false }, { "getrawmempool", &getrawmempool, true, false, false },
{ "decoderawtransaction", &decoderawtransaction, false, false, false },
{ "decodescript", &decodescript, false, false, false },
{ "signrawtransaction", &signrawtransaction, false, false, false },
{ "sendrawtransaction", &sendrawtransaction, false, false, false },
{ "gettxoutsetinfo", &gettxoutsetinfo, true, false, false },
{ "gettxout", &gettxout, true, false, false }, { "gettxout", &gettxout, true, false, false },
{ "gettxoutsetinfo", &gettxoutsetinfo, true, false, false },
{ "verifychain", &verifychain, true, false, false }, { "verifychain", &verifychain, true, false, false },
/* Mining */ /* Mining */
{ "getnetworkhashps", &getnetworkhashps, true, false, false },
{ "getmininginfo", &getmininginfo, true, false, false },
{ "getblocktemplate", &getblocktemplate, true, false, false }, { "getblocktemplate", &getblocktemplate, true, false, false },
{ "getmininginfo", &getmininginfo, true, false, false },
{ "getnetworkhashps", &getnetworkhashps, true, false, false },
{ "submitblock", &submitblock, false, false, false }, { "submitblock", &submitblock, false, false, false },
{ "validateaddress", &validateaddress, true, false, false },
/* Raw transactions */
{ "createrawtransaction", &createrawtransaction, false, false, false },
{ "decoderawtransaction", &decoderawtransaction, false, false, false },
{ "decodescript", &decodescript, false, false, false },
{ "getrawtransaction", &getrawtransaction, false, false, false },
{ "sendrawtransaction", &sendrawtransaction, false, false, false },
{ "signrawtransaction", &signrawtransaction, false, false, false }, /* uses wallet if enabled */
/* Utility functions */
{ "createmultisig", &createmultisig, true, true , false }, { "createmultisig", &createmultisig, true, true , false },
{ "validateaddress", &validateaddress, true, false, false }, /* uses wallet if enabled */
{ "verifymessage", &verifymessage, false, false, false }, { "verifymessage", &verifymessage, false, false, false },
#ifdef ENABLE_WALLET #ifdef ENABLE_WALLET
/* Wallet */ /* Wallet */
{ "getnewaddress", &getnewaddress, true, false, true }, { "addmultisigaddress", &addmultisigaddress, false, false, true },
{ "backupwallet", &backupwallet, true, false, true },
{ "dumpprivkey", &dumpprivkey, true, false, true },
{ "dumpwallet", &dumpwallet, true, false, true },
{ "encryptwallet", &encryptwallet, false, false, true },
{ "getaccountaddress", &getaccountaddress, true, false, true }, { "getaccountaddress", &getaccountaddress, true, false, true },
{ "getrawchangeaddress", &getrawchangeaddress, true, false, true },
{ "setaccount", &setaccount, true, false, true },
{ "getaccount", &getaccount, false, false, true }, { "getaccount", &getaccount, false, false, true },
{ "getaddressesbyaccount", &getaddressesbyaccount, true, false, true }, { "getaddressesbyaccount", &getaddressesbyaccount, true, false, true },
{ "sendtoaddress", &sendtoaddress, false, false, true },
{ "getreceivedbyaddress", &getreceivedbyaddress, false, false, true },
{ "getreceivedbyaccount", &getreceivedbyaccount, false, false, true },
{ "listreceivedbyaddress", &listreceivedbyaddress, false, false, true },
{ "listreceivedbyaccount", &listreceivedbyaccount, false, false, true },
{ "backupwallet", &backupwallet, true, false, true },
{ "keypoolrefill", &keypoolrefill, true, false, true },
{ "walletpassphrase", &walletpassphrase, true, false, true },
{ "walletpassphrasechange", &walletpassphrasechange, false, false, true },
{ "walletlock", &walletlock, true, false, true },
{ "encryptwallet", &encryptwallet, false, false, true },
{ "getbalance", &getbalance, false, false, true }, { "getbalance", &getbalance, false, false, true },
{ "getunconfirmedbalance", &getunconfirmedbalance, false, false, true }, { "getnewaddress", &getnewaddress, true, false, true },
{ "move", &movecmd, false, false, true }, { "getrawchangeaddress", &getrawchangeaddress, true, false, true },
{ "sendfrom", &sendfrom, false, false, true }, { "getreceivedbyaccount", &getreceivedbyaccount, false, false, true },
{ "sendmany", &sendmany, false, false, true }, { "getreceivedbyaddress", &getreceivedbyaddress, false, false, true },
{ "addmultisigaddress", &addmultisigaddress, false, false, true },
{ "gettransaction", &gettransaction, false, false, true }, { "gettransaction", &gettransaction, false, false, true },
{ "listtransactions", &listtransactions, false, false, true }, { "getunconfirmedbalance", &getunconfirmedbalance, false, false, true },
{ "listaddressgroupings", &listaddressgroupings, false, false, true }, { "getwalletinfo", &getwalletinfo, true, false, true },
{ "signmessage", &signmessage, false, false, true },
{ "listaccounts", &listaccounts, false, false, true },
{ "listsinceblock", &listsinceblock, false, false, true },
{ "dumpprivkey", &dumpprivkey, true, false, true },
{ "dumpwallet", &dumpwallet, true, false, true },
{ "importprivkey", &importprivkey, false, false, true }, { "importprivkey", &importprivkey, false, false, true },
{ "importwallet", &importwallet, false, false, true }, { "importwallet", &importwallet, false, false, true },
{ "keypoolrefill", &keypoolrefill, true, false, true },
{ "listaccounts", &listaccounts, false, false, true },
{ "listaddressgroupings", &listaddressgroupings, false, false, true },
{ "listlockunspent", &listlockunspent, false, false, true },
{ "listreceivedbyaccount", &listreceivedbyaccount, false, false, true },
{ "listreceivedbyaddress", &listreceivedbyaddress, false, false, true },
{ "listsinceblock", &listsinceblock, false, false, true },
{ "listtransactions", &listtransactions, false, false, true },
{ "listunspent", &listunspent, false, false, true }, { "listunspent", &listunspent, false, false, true },
{ "lockunspent", &lockunspent, false, false, true }, { "lockunspent", &lockunspent, false, false, true },
{ "listlockunspent", &listlockunspent, false, false, true }, { "move", &movecmd, false, false, true },
{ "sendfrom", &sendfrom, false, false, true },
{ "sendmany", &sendmany, false, false, true },
{ "sendtoaddress", &sendtoaddress, false, false, true },
{ "setaccount", &setaccount, true, false, true },
{ "settxfee", &settxfee, false, false, true }, { "settxfee", &settxfee, false, false, true },
{ "getwalletinfo", &getwalletinfo, true, false, true }, { "signmessage", &signmessage, false, false, true },
{ "walletlock", &walletlock, true, false, true },
{ "walletpassphrasechange", &walletpassphrasechange, false, false, true },
{ "walletpassphrase", &walletpassphrase, true, false, true },
/* Wallet-enabled mining */ /* Wallet-enabled mining */
{ "getgenerate", &getgenerate, true, false, false }, { "getgenerate", &getgenerate, true, false, false },
{ "setgenerate", &setgenerate, true, true, false },
{ "gethashespersec", &gethashespersec, true, false, false }, { "gethashespersec", &gethashespersec, true, false, false },
{ "getwork", &getwork, true, false, true }, { "getwork", &getwork, true, false, true },
{ "setgenerate", &setgenerate, true, true, false },
#endif // ENABLE_WALLET #endif // ENABLE_WALLET
}; };

Loading…
Cancel
Save