From e96b79da67a13e1a37721aea6afe3bdab247d5ea Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Fri, 15 Jan 2016 11:55:17 +1100 Subject: [PATCH 1/2] move rpc* to rpc/ --- src/Makefile.am | 26 ++++---- src/dash-cli.cpp | 4 +- src/dashd.cpp | 3 +- src/httprpc.cpp | 4 +- src/httpserver.cpp | 2 +- src/init.cpp | 2 +- src/keepass.cpp | 2 +- src/qt/dash.cpp | 2 +- src/qt/rpcconsole.cpp | 4 +- src/rest.cpp | 2 +- src/{rpcblockchain.cpp => rpc/blockchain.cpp} | 2 +- src/{rpcclient.cpp => rpc/client.cpp} | 5 +- src/{rpcclient.h => rpc/client.h} | 0 src/{rpcgovernance.cpp => rpc/governance.cpp} | 2 +- src/{rpcmasternode.cpp => rpc/masternode.cpp} | 2 +- src/{rpcmining.cpp => rpc/mining.cpp} | 2 +- src/{rpcmisc.cpp => rpc/misc.cpp} | 2 +- src/{rpcnet.cpp => rpc/net.cpp} | 2 +- src/{rpcprotocol.cpp => rpc/protocol.cpp} | 2 +- src/{rpcprotocol.h => rpc/protocol.h} | 0 .../rawtransaction.cpp} | 2 +- src/{rpcserver.cpp => rpc/server.cpp} | 2 +- src/{rpcserver.h => rpc/server.h} | 2 +- src/test/rpc_tests.cpp | 6 +- src/test/rpc_wallet_tests.cpp | 4 +- src/wallet/rpcdump.cpp | 2 +- src/wallet/rpcwallet.cpp | 66 +++++++++---------- 27 files changed, 76 insertions(+), 78 deletions(-) rename src/{rpcblockchain.cpp => rpc/blockchain.cpp} (99%) rename src/{rpcclient.cpp => rpc/client.cpp} (99%) rename src/{rpcclient.h => rpc/client.h} (100%) rename src/{rpcgovernance.cpp => rpc/governance.cpp} (99%) rename src/{rpcmasternode.cpp => rpc/masternode.cpp} (99%) rename src/{rpcmining.cpp => rpc/mining.cpp} (99%) rename src/{rpcmisc.cpp => rpc/misc.cpp} (99%) rename src/{rpcnet.cpp => rpc/net.cpp} (99%) rename src/{rpcprotocol.cpp => rpc/protocol.cpp} (99%) rename src/{rpcprotocol.h => rpc/protocol.h} (100%) rename src/{rpcrawtransaction.cpp => rpc/rawtransaction.cpp} (99%) rename src/{rpcserver.cpp => rpc/server.cpp} (99%) rename src/{rpcserver.h => rpc/server.h} (99%) diff --git a/src/Makefile.am b/src/Makefile.am index 1bc57ea651c4..c03150e4a9e5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -146,9 +146,9 @@ BITCOIN_CORE_H = \ pubkey.h \ random.h \ reverselock.h \ - rpcclient.h \ - rpcprotocol.h \ - rpcserver.h \ + rpc/client.h \ + rpc/protocol.h \ + rpc/server.h \ scheduler.h \ script/interpreter.h \ script/script.h \ @@ -229,14 +229,14 @@ libbitcoin_server_a_SOURCES = \ privatesend.cpp \ privatesend-server.cpp \ rest.cpp \ - rpcblockchain.cpp \ - rpcmasternode.cpp \ - rpcgovernance.cpp \ - rpcmining.cpp \ - rpcmisc.cpp \ - rpcnet.cpp \ - rpcrawtransaction.cpp \ - rpcserver.cpp \ + rpc/blockchain.cpp \ + rpc/masternode.cpp \ + rpc/governance.cpp \ + rpc/mining.cpp \ + rpc/misc.cpp \ + rpc/net.cpp \ + rpc/rawtransaction.cpp \ + rpc/server.cpp \ script/sigcache.cpp \ sendalert.cpp \ timedata.cpp \ @@ -372,7 +372,7 @@ libbitcoin_util_a_SOURCES = \ compat/glibcxx_sanity.cpp \ compat/strnlen.cpp \ random.cpp \ - rpcprotocol.cpp \ + rpc/protocol.cpp \ support/cleanse.cpp \ sync.cpp \ uint256.cpp \ @@ -390,7 +390,7 @@ endif libbitcoin_cli_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) libbitcoin_cli_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) libbitcoin_cli_a_SOURCES = \ - rpcclient.cpp \ + rpc/client.cpp \ $(BITCOIN_CORE_H) nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h diff --git a/src/dash-cli.cpp b/src/dash-cli.cpp index 6d75c71f6562..693fbf15697f 100644 --- a/src/dash-cli.cpp +++ b/src/dash-cli.cpp @@ -6,8 +6,8 @@ #include "chainparamsbase.h" #include "clientversion.h" -#include "rpcclient.h" -#include "rpcprotocol.h" +#include "rpc/client.h" +#include "rpc/protocol.h" #include "util.h" #include "utilstrencodings.h" diff --git a/src/dashd.cpp b/src/dashd.cpp index f790a8d536b8..5d1cb3255598 100644 --- a/src/dashd.cpp +++ b/src/dashd.cpp @@ -6,7 +6,7 @@ #include "chainparams.h" #include "clientversion.h" -#include "rpcserver.h" +#include "rpc/server.h" #include "init.h" #include "noui.h" #include "scheduler.h" @@ -14,7 +14,6 @@ #include "masternodeconfig.h" #include "httpserver.h" #include "httprpc.h" -#include "rpcserver.h" #include #include diff --git a/src/httprpc.cpp b/src/httprpc.cpp index 57b3f9a09d35..ec370cc879c9 100644 --- a/src/httprpc.cpp +++ b/src/httprpc.cpp @@ -3,8 +3,8 @@ #include "base58.h" #include "chainparams.h" #include "httpserver.h" -#include "rpcprotocol.h" -#include "rpcserver.h" +#include "rpc/protocol.h" +#include "rpc/server.h" #include "random.h" #include "sync.h" #include "util.h" diff --git a/src/httpserver.cpp b/src/httpserver.cpp index 0315c1e062b2..18515e7c4d46 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -8,7 +8,7 @@ #include "compat.h" #include "util.h" #include "netbase.h" -#include "rpcprotocol.h" // For HTTP status codes +#include "rpc/protocol.h" // For HTTP status codes #include "sync.h" #include "ui_interface.h" diff --git a/src/init.cpp b/src/init.cpp index 9b760dfc4000..79ebc06bd80f 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -25,7 +25,7 @@ #include "net.h" #include "netfulfilledman.h" #include "policy/policy.h" -#include "rpcserver.h" +#include "rpc/server.h" #include "script/standard.h" #include "script/sigcache.h" #include "scheduler.h" diff --git a/src/keepass.cpp b/src/keepass.cpp index 2ba4ab10a974..c84429b0423b 100644 --- a/src/keepass.cpp +++ b/src/keepass.cpp @@ -8,7 +8,7 @@ #include "clientversion.h" #include "protocol.h" #include "random.h" -#include "rpcprotocol.h" +#include "rpc/protocol.h" // Necessary to prevent compile errors due to forward declaration of //CScript in serialize.h (included from crypter.h) diff --git a/src/qt/dash.cpp b/src/qt/dash.cpp index bcdf80d400b0..82086382ef19 100644 --- a/src/qt/dash.cpp +++ b/src/qt/dash.cpp @@ -29,7 +29,7 @@ #include "masternodeconfig.h" #include "init.h" -#include "rpcserver.h" +#include "rpc/server.h" #include "scheduler.h" #include "ui_interface.h" #include "util.h" diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index a250dff5df5a..15bd31896e66 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -12,8 +12,8 @@ #include "platformstyle.h" #include "chainparams.h" -#include "rpcserver.h" -#include "rpcclient.h" +#include "rpc/server.h" +#include "rpc/client.h" #include "util.h" #include diff --git a/src/rest.cpp b/src/rest.cpp index ad884dac1c08..ebdccc94021b 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -9,7 +9,7 @@ #include "primitives/transaction.h" #include "main.h" #include "httpserver.h" -#include "rpcserver.h" +#include "rpc/server.h" #include "streams.h" #include "sync.h" #include "txmempool.h" diff --git a/src/rpcblockchain.cpp b/src/rpc/blockchain.cpp similarity index 99% rename from src/rpcblockchain.cpp rename to src/rpc/blockchain.cpp index 1912e8f63bb3..485d5333c96d 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -13,7 +13,7 @@ #include "main.h" #include "policy/policy.h" #include "primitives/transaction.h" -#include "rpcserver.h" +#include "rpc/server.h" #include "streams.h" #include "sync.h" #include "txmempool.h" diff --git a/src/rpcclient.cpp b/src/rpc/client.cpp similarity index 99% rename from src/rpcclient.cpp rename to src/rpc/client.cpp index f8e985a8c929..ac492e9cb779 100644 --- a/src/rpcclient.cpp +++ b/src/rpc/client.cpp @@ -4,9 +4,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "rpcclient.h" - -#include "rpcprotocol.h" +#include "rpc/client.h" +#include "rpc/protocol.h" #include "util.h" #include diff --git a/src/rpcclient.h b/src/rpc/client.h similarity index 100% rename from src/rpcclient.h rename to src/rpc/client.h diff --git a/src/rpcgovernance.cpp b/src/rpc/governance.cpp similarity index 99% rename from src/rpcgovernance.cpp rename to src/rpc/governance.cpp index b89f8655e904..52dee66d46a2 100644 --- a/src/rpcgovernance.cpp +++ b/src/rpc/governance.cpp @@ -16,7 +16,7 @@ #include "masternodeconfig.h" #include "masternodeman.h" #include "messagesigner.h" -#include "rpcserver.h" +#include "rpc/server.h" #include "util.h" #include "utilmoneystr.h" diff --git a/src/rpcmasternode.cpp b/src/rpc/masternode.cpp similarity index 99% rename from src/rpcmasternode.cpp rename to src/rpc/masternode.cpp index 828b512ed865..1d44cda6142a 100644 --- a/src/rpcmasternode.cpp +++ b/src/rpc/masternode.cpp @@ -11,7 +11,7 @@ #include "masternodeman.h" #include "privatesend-client.h" #include "privatesend-server.h" -#include "rpcserver.h" +#include "rpc/server.h" #include "util.h" #include "utilmoneystr.h" diff --git a/src/rpcmining.cpp b/src/rpc/mining.cpp similarity index 99% rename from src/rpcmining.cpp rename to src/rpc/mining.cpp index 55831ed22968..c53ee4b09440 100644 --- a/src/rpcmining.cpp +++ b/src/rpc/mining.cpp @@ -17,7 +17,7 @@ #include "miner.h" #include "net.h" #include "pow.h" -#include "rpcserver.h" +#include "rpc/server.h" #include "spork.h" #include "txmempool.h" #include "util.h" diff --git a/src/rpcmisc.cpp b/src/rpc/misc.cpp similarity index 99% rename from src/rpcmisc.cpp rename to src/rpc/misc.cpp index 8913ba47ee7f..d41b6df37e47 100644 --- a/src/rpcmisc.cpp +++ b/src/rpc/misc.cpp @@ -10,7 +10,7 @@ #include "main.h" #include "net.h" #include "netbase.h" -#include "rpcserver.h" +#include "rpc/server.h" #include "timedata.h" #include "txmempool.h" #include "util.h" diff --git a/src/rpcnet.cpp b/src/rpc/net.cpp similarity index 99% rename from src/rpcnet.cpp rename to src/rpc/net.cpp index 186347c174ff..ec1425294abb 100644 --- a/src/rpcnet.cpp +++ b/src/rpc/net.cpp @@ -3,7 +3,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "rpcserver.h" +#include "rpc/server.h" #include "chainparams.h" #include "clientversion.h" diff --git a/src/rpcprotocol.cpp b/src/rpc/protocol.cpp similarity index 99% rename from src/rpcprotocol.cpp rename to src/rpc/protocol.cpp index d67594f72808..c801313e5c5f 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpc/protocol.cpp @@ -4,7 +4,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "rpcprotocol.h" +#include "rpc/protocol.h" #include "random.h" #include "tinyformat.h" diff --git a/src/rpcprotocol.h b/src/rpc/protocol.h similarity index 100% rename from src/rpcprotocol.h rename to src/rpc/protocol.h diff --git a/src/rpcrawtransaction.cpp b/src/rpc/rawtransaction.cpp similarity index 99% rename from src/rpcrawtransaction.cpp rename to src/rpc/rawtransaction.cpp index f603b4ef958c..b354ffa6efeb 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -16,7 +16,7 @@ #include "net.h" #include "policy/policy.h" #include "primitives/transaction.h" -#include "rpcserver.h" +#include "rpc/server.h" #include "script/script.h" #include "script/script_error.h" #include "script/sign.h" diff --git a/src/rpcserver.cpp b/src/rpc/server.cpp similarity index 99% rename from src/rpcserver.cpp rename to src/rpc/server.cpp index f687b9a5ae5d..0059294bba1d 100644 --- a/src/rpcserver.cpp +++ b/src/rpc/server.cpp @@ -4,7 +4,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "rpcserver.h" +#include "rpc/server.h" #include "base58.h" #include "init.h" diff --git a/src/rpcserver.h b/src/rpc/server.h similarity index 99% rename from src/rpcserver.h rename to src/rpc/server.h index 8f81ba1ed2ac..7ce8cf8416c3 100644 --- a/src/rpcserver.h +++ b/src/rpc/server.h @@ -7,7 +7,7 @@ #define BITCOIN_RPCSERVER_H #include "amount.h" -#include "rpcprotocol.h" +#include "rpc/protocol.h" #include "uint256.h" #include diff --git a/src/test/rpc_tests.cpp b/src/test/rpc_tests.cpp index 186c98325fbb..973c8eab1d94 100644 --- a/src/test/rpc_tests.cpp +++ b/src/test/rpc_tests.cpp @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "rpcserver.h" -#include "rpcclient.h" +#include "rpc/server.h" +#include "rpc/client.h" #include "base58.h" #include "netbase.h" @@ -259,7 +259,7 @@ BOOST_AUTO_TEST_CASE(rpc_ban) adr = find_value(o1, "address"); banned_until = find_value(o1, "banned_until"); BOOST_CHECK_EQUAL(adr.get_str(), "127.0.0.0/24"); - int64_t now = GetTime(); + int64_t now = GetTime(); BOOST_CHECK(banned_until.get_int64() > now); BOOST_CHECK(banned_until.get_int64()-now <= 200); diff --git a/src/test/rpc_wallet_tests.cpp b/src/test/rpc_wallet_tests.cpp index 9997b02ccc0b..73cf0ab68afa 100644 --- a/src/test/rpc_wallet_tests.cpp +++ b/src/test/rpc_wallet_tests.cpp @@ -2,8 +2,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "rpcserver.h" -#include "rpcclient.h" +#include "rpc/server.h" +#include "rpc/client.h" #include "base58.h" #include "main.h" diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index e2685c751d56..d2a4b379c2ac 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -5,7 +5,7 @@ #include "base58.h" #include "chain.h" -#include "rpcserver.h" +#include "rpc/server.h" #include "init.h" #include "main.h" #include "script/script.h" diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index d2d174e4efc7..69342e63d4d0 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -13,7 +13,7 @@ #include "net.h" #include "netbase.h" #include "policy/rbf.h" -#include "rpcserver.h" +#include "rpc/server.h" #include "timedata.h" #include "util.h" #include "utilmoneystr.h" @@ -114,7 +114,7 @@ UniValue getnewaddress(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() > 1) throw runtime_error( "getnewaddress ( \"account\" )\n" @@ -193,7 +193,7 @@ UniValue getaccountaddress(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() != 1) throw runtime_error( "getaccountaddress \"account\"\n" @@ -225,7 +225,7 @@ UniValue getrawchangeaddress(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() > 1) throw runtime_error( "getrawchangeaddress\n" @@ -260,7 +260,7 @@ UniValue setaccount(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( "setaccount \"dashaddress\" \"account\"\n" @@ -306,7 +306,7 @@ UniValue getaccount(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() != 1) throw runtime_error( "getaccount \"dashaddress\"\n" @@ -338,7 +338,7 @@ UniValue getaddressesbyaccount(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() != 1) throw runtime_error( "getaddressesbyaccount \"account\"\n" @@ -532,7 +532,7 @@ UniValue listaddressgroupings(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp) throw runtime_error( "listaddressgroupings\n" @@ -583,7 +583,7 @@ UniValue signmessage(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() != 2) throw runtime_error( "signmessage \"dashaddress\" \"message\"\n" @@ -639,7 +639,7 @@ UniValue getreceivedbyaddress(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( "getreceivedbyaddress \"dashaddress\" ( minconf )\n" @@ -697,7 +697,7 @@ UniValue getreceivedbyaccount(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( "getreceivedbyaccount \"account\" ( minconf )\n" @@ -786,7 +786,7 @@ UniValue getbalance(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() > 3) throw runtime_error( "getbalance ( \"account\" minconf includeWatchonly )\n" @@ -861,7 +861,7 @@ UniValue getunconfirmedbalance(const UniValue ¶ms, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() > 0) throw runtime_error( "getunconfirmedbalance\n" @@ -877,7 +877,7 @@ UniValue movecmd(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() < 3 || params.size() > 5) throw runtime_error( "move \"fromaccount\" \"toaccount\" amount ( minconf \"comment\" )\n" @@ -950,7 +950,7 @@ UniValue sendfrom(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() < 3 || params.size() > 6) throw runtime_error( "sendfrom \"fromaccount\" \"todashaddress\" amount ( minconf \"comment\" \"comment-to\" )\n" @@ -1136,7 +1136,7 @@ UniValue addmultisigaddress(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() < 2 || params.size() > 3) { string msg = "addmultisigaddress nrequired [\"key\",...] ( \"account\" )\n" @@ -1329,7 +1329,7 @@ UniValue listreceivedbyaddress(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() > 3) throw runtime_error( "listreceivedbyaddress ( minconf includeempty includeWatchonly)\n" @@ -1368,7 +1368,7 @@ UniValue listreceivedbyaccount(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() > 3) throw runtime_error( "listreceivedbyaccount ( minconf includeempty includeWatchonly)\n" @@ -1506,7 +1506,7 @@ UniValue listtransactions(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() > 4) throw runtime_error( "listtransactions ( \"account\" count from includeWatchonly)\n" @@ -1635,7 +1635,7 @@ UniValue listaccounts(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() > 2) throw runtime_error( "listaccounts ( minconf includeWatchonly)\n" @@ -1714,7 +1714,7 @@ UniValue listsinceblock(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp) throw runtime_error( "listsinceblock ( \"blockhash\" target-confirmations includeWatchonly)\n" @@ -1809,7 +1809,7 @@ UniValue gettransaction(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( "gettransaction \"txid\" ( includeWatchonly )\n" @@ -1925,7 +1925,7 @@ UniValue backupwallet(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() != 1) throw runtime_error( "backupwallet \"destination\"\n" @@ -1951,7 +1951,7 @@ UniValue keypoolrefill(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() > 1) throw runtime_error( "keypoolrefill ( newsize )\n" @@ -2062,7 +2062,7 @@ UniValue walletpassphrasechange(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (pwalletMain->IsCrypted() && (fHelp || params.size() != 2)) throw runtime_error( "walletpassphrasechange \"oldpassphrase\" \"newpassphrase\"\n" @@ -2108,7 +2108,7 @@ UniValue walletlock(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (pwalletMain->IsCrypted() && (fHelp || params.size() != 0)) throw runtime_error( "walletlock\n" @@ -2147,7 +2147,7 @@ UniValue encryptwallet(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (!pwalletMain->IsCrypted() && (fHelp || params.size() != 1)) throw runtime_error( "encryptwallet \"passphrase\"\n" @@ -2204,7 +2204,7 @@ UniValue lockunspent(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() < 1 || params.size() > 2) throw runtime_error( "lockunspent unlock [{\"txid\":\"txid\",\"vout\":n},...]\n" @@ -2288,7 +2288,7 @@ UniValue listlockunspent(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() > 0) throw runtime_error( "listlockunspent\n" @@ -2337,7 +2337,7 @@ UniValue settxfee(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() < 1 || params.size() > 1) throw runtime_error( "settxfee amount\n" @@ -2364,7 +2364,7 @@ UniValue getwalletinfo(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() != 0) throw runtime_error( "getwalletinfo\n" @@ -2493,7 +2493,7 @@ UniValue resendwallettransactions(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() != 0) throw runtime_error( "resendwallettransactions\n" @@ -2518,7 +2518,7 @@ UniValue listunspent(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() > 3) throw runtime_error( "listunspent ( minconf maxconf [\"address\",...] )\n" From be38dc70dd1131b864cd3a3507b532a3ee058b15 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Fri, 15 Jan 2016 12:55:57 +1100 Subject: [PATCH 2/2] rpc: update inline comments to refer to new file paths --- qa/rpc-tests/blockchain.py | 2 +- src/rpc/server.h | 8 ++++---- src/wallet/rpcwallet.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qa/rpc-tests/blockchain.py b/qa/rpc-tests/blockchain.py index 5d568b803cd1..b30b7cf7a2e2 100755 --- a/qa/rpc-tests/blockchain.py +++ b/qa/rpc-tests/blockchain.py @@ -5,7 +5,7 @@ # # Test RPC calls related to blockchain state. Tests correspond to code in -# rpcblockchain.cpp. +# rpc/blockchain.cpp. # from decimal import Decimal diff --git a/src/rpc/server.h b/src/rpc/server.h index 7ce8cf8416c3..d092f6b89b5f 100644 --- a/src/rpc/server.h +++ b/src/rpc/server.h @@ -171,7 +171,7 @@ extern std::string HelpExampleRpc(const std::string& methodname, const std::stri extern void EnsureWalletIsUnlocked(); -extern UniValue getconnectioncount(const UniValue& params, bool fHelp); // in rpcnet.cpp +extern UniValue getconnectioncount(const UniValue& params, bool fHelp); // in rpc/net.cpp extern UniValue getaddressmempool(const UniValue& params, bool fHelp); extern UniValue getaddressutxos(const UniValue& params, bool fHelp); extern UniValue getaddressdeltas(const UniValue& params, bool fHelp); @@ -197,7 +197,7 @@ extern UniValue dumpwallet(const UniValue& params, bool fHelp); extern UniValue importwallet(const UniValue& params, bool fHelp); extern UniValue importelectrumwallet(const UniValue& params, bool fHelp); -extern UniValue getgenerate(const UniValue& params, bool fHelp); // in rpcmining.cpp +extern UniValue getgenerate(const UniValue& params, bool fHelp); // in rpc/mining.cpp extern UniValue setgenerate(const UniValue& params, bool fHelp); extern UniValue generate(const UniValue& params, bool fHelp); extern UniValue getnetworkhashps(const UniValue& params, bool fHelp); @@ -253,7 +253,7 @@ extern UniValue getnetworkinfo(const UniValue& params, bool fHelp); extern UniValue setmocktime(const UniValue& params, bool fHelp); extern UniValue resendwallettransactions(const UniValue& params, bool fHelp); -extern UniValue getrawtransaction(const UniValue& params, bool fHelp); // in rcprawtransaction.cpp +extern UniValue getrawtransaction(const UniValue& params, bool fHelp); // in rpc/rawtransaction.cpp extern UniValue listunspent(const UniValue& params, bool fHelp); extern UniValue lockunspent(const UniValue& params, bool fHelp); extern UniValue listlockunspent(const UniValue& params, bool fHelp); @@ -278,7 +278,7 @@ extern UniValue getsuperblockbudget(const UniValue& params, bool fHelp); extern UniValue voteraw(const UniValue& params, bool fHelp); extern UniValue mnsync(const UniValue& params, bool fHelp); -extern UniValue getblockcount(const UniValue& params, bool fHelp); // in rpcblockchain.cpp +extern UniValue getblockcount(const UniValue& params, bool fHelp); // in rpc/blockchain.cpp extern UniValue getbestblockhash(const UniValue& params, bool fHelp); extern UniValue getdifficulty(const UniValue& params, bool fHelp); extern UniValue settxfee(const UniValue& params, bool fHelp); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 69342e63d4d0..e368c4407b0f 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -1129,7 +1129,7 @@ UniValue sendmany(const UniValue& params, bool fHelp) return wtx.GetHash().GetHex(); } -// Defined in rpcmisc.cpp +// Defined in rpc/misc.cpp extern CScript _createmultisig_redeemScript(const UniValue& params); UniValue addmultisigaddress(const UniValue& params, bool fHelp)