From a0eaff8a1d18ebba33cdea4cd1efaddeb55519e7 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Fri, 15 Jan 2016 11:55:17 +1100 Subject: [PATCH] move rpc* to rpc/ --- src/Makefile.am | 22 +++--- src/bitcoin-cli.cpp | 4 +- src/bitcoind.cpp | 3 +- src/httprpc.cpp | 4 +- src/httpserver.cpp | 2 +- src/init.cpp | 2 +- src/qt/bitcoin.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/{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 | 72 +++++++++---------- 24 files changed, 74 insertions(+), 76 deletions(-) rename src/{rpcblockchain.cpp => rpc/blockchain.cpp} (99%) rename src/{rpcclient.cpp => rpc/client.cpp} (98%) rename src/{rpcclient.h => rpc/client.h} (100%) 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 948d12424..9a6b4fd66 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -131,9 +131,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 \ @@ -203,12 +203,12 @@ libbitcoin_server_a_SOURCES = \ policy/policy.cpp \ pow.cpp \ rest.cpp \ - rpcblockchain.cpp \ - rpcmining.cpp \ - rpcmisc.cpp \ - rpcnet.cpp \ - rpcrawtransaction.cpp \ - rpcserver.cpp \ + rpc/blockchain.cpp \ + rpc/mining.cpp \ + rpc/misc.cpp \ + rpc/net.cpp \ + rpc/rawtransaction.cpp \ + rpc/server.cpp \ script/sigcache.cpp \ timedata.cpp \ torcontrol.cpp \ @@ -304,7 +304,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 \ @@ -322,7 +322,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/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index fb2052108..d1d534b05 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -5,8 +5,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/bitcoind.cpp b/src/bitcoind.cpp index 3b6608c95..d1fd56d17 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -5,14 +5,13 @@ #include "chainparams.h" #include "clientversion.h" -#include "rpcserver.h" +#include "rpc/server.h" #include "init.h" #include "noui.h" #include "scheduler.h" #include "util.h" #include "httpserver.h" #include "httprpc.h" -#include "rpcserver.h" #include #include diff --git a/src/httprpc.cpp b/src/httprpc.cpp index 1466dc0cb..e7c28238b 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 91518d7c5..ce1accb04 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 282ede55c..fada53536 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -23,7 +23,7 @@ #include "miner.h" #include "net.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/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index dcf752cc3..b33df45fb 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -26,7 +26,7 @@ #endif #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 7178bc00e..2658e867c 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -12,8 +12,8 @@ #include "bantablemodel.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 ad884dac1..ebdccc940 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 954441d15..de6bda4ea 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -12,7 +12,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 98% rename from src/rpcclient.cpp rename to src/rpc/client.cpp index 047158023..b0e9b6f15 100644 --- a/src/rpcclient.cpp +++ b/src/rpc/client.cpp @@ -3,9 +3,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/rpcmining.cpp b/src/rpc/mining.cpp similarity index 99% rename from src/rpcmining.cpp rename to src/rpc/mining.cpp index 958c817d6..996b7f9cb 100644 --- a/src/rpcmining.cpp +++ b/src/rpc/mining.cpp @@ -14,7 +14,7 @@ #include "miner.h" #include "net.h" #include "pow.h" -#include "rpcserver.h" +#include "rpc/server.h" #include "txmempool.h" #include "util.h" #include "utilstrencodings.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 9871c3fcc..0aab9c304 100644 --- a/src/rpcmisc.cpp +++ b/src/rpc/misc.cpp @@ -9,7 +9,7 @@ #include "main.h" #include "net.h" #include "netbase.h" -#include "rpcserver.h" +#include "rpc/server.h" #include "timedata.h" #include "util.h" #include "utilstrencodings.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 b61e7c5f1..065214a98 100644 --- a/src/rpcnet.cpp +++ b/src/rpc/net.cpp @@ -2,7 +2,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 b7605545d..f5275062a 100644 --- a/src/rpcprotocol.cpp +++ b/src/rpc/protocol.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 "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 64bf569ba..2ec80f468 100644 --- a/src/rpcrawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -15,7 +15,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 b638598f7..b2d4559cc 100644 --- a/src/rpcserver.cpp +++ b/src/rpc/server.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 "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 219d0422d..38a237d62 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 cc52e3ea0..d6309ca38 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" @@ -260,7 +260,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 398372af3..3443be209 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 b025c3745..9ec28e7b9 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -4,7 +4,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 e54293395..8a2d938ae 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -12,7 +12,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" @@ -110,7 +110,7 @@ UniValue getnewaddress(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() > 1) throw runtime_error( "getnewaddress ( \"account\" )\n" @@ -189,7 +189,7 @@ UniValue getaccountaddress(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() != 1) throw runtime_error( "getaccountaddress \"account\"\n" @@ -221,7 +221,7 @@ UniValue getrawchangeaddress(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() > 1) throw runtime_error( "getrawchangeaddress\n" @@ -256,7 +256,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 \"bitcoinaddress\" \"account\"\n" @@ -302,7 +302,7 @@ UniValue getaccount(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() != 1) throw runtime_error( "getaccount \"bitcoinaddress\"\n" @@ -334,7 +334,7 @@ UniValue getaddressesbyaccount(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() != 1) throw runtime_error( "getaddressesbyaccount \"account\"\n" @@ -402,7 +402,7 @@ UniValue sendtoaddress(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() < 2 || params.size() > 5) throw runtime_error( "sendtoaddress \"bitcoinaddress\" amount ( \"comment\" \"comment-to\" subtractfeefromamount )\n" @@ -460,7 +460,7 @@ UniValue listaddressgroupings(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp) throw runtime_error( "listaddressgroupings\n" @@ -511,7 +511,7 @@ UniValue signmessage(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() != 2) throw runtime_error( "signmessage \"bitcoinaddress\" \"message\"\n" @@ -567,7 +567,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 \"bitcoinaddress\" ( minconf )\n" @@ -625,7 +625,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" @@ -714,7 +714,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" @@ -789,7 +789,7 @@ UniValue getunconfirmedbalance(const UniValue ¶ms, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() > 0) throw runtime_error( "getunconfirmedbalance\n" @@ -805,7 +805,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" @@ -878,7 +878,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\" \"tobitcoinaddress\" amount ( minconf \"comment\" \"comment-to\" )\n" @@ -942,7 +942,7 @@ UniValue sendmany(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() < 2 || params.size() > 5) throw runtime_error( "sendmany \"fromaccount\" {\"address\":amount,...} ( minconf \"comment\" [\"address\",...] )\n" @@ -1056,7 +1056,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" @@ -1239,7 +1239,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" @@ -1277,7 +1277,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" @@ -1412,7 +1412,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" @@ -1538,7 +1538,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" @@ -1617,7 +1617,7 @@ UniValue listsinceblock(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp) throw runtime_error( "listsinceblock ( \"blockhash\" target-confirmations includeWatchonly)\n" @@ -1709,7 +1709,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" @@ -1824,7 +1824,7 @@ UniValue backupwallet(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() != 1) throw runtime_error( "backupwallet \"destination\"\n" @@ -1850,7 +1850,7 @@ UniValue keypoolrefill(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() > 1) throw runtime_error( "keypoolrefill ( newsize )\n" @@ -1894,7 +1894,7 @@ UniValue walletpassphrase(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (pwalletMain->IsCrypted() && (fHelp || params.size() != 2)) throw runtime_error( "walletpassphrase \"passphrase\" timeout\n" @@ -1954,7 +1954,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" @@ -2000,7 +2000,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" @@ -2039,7 +2039,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" @@ -2096,7 +2096,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" @@ -2180,7 +2180,7 @@ UniValue listlockunspent(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() > 0) throw runtime_error( "listlockunspent\n" @@ -2229,7 +2229,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" @@ -2256,7 +2256,7 @@ UniValue getwalletinfo(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() != 0) throw runtime_error( "getwalletinfo\n" @@ -2298,7 +2298,7 @@ UniValue resendwallettransactions(const UniValue& params, bool fHelp) { if (!EnsureWalletIsAvailable(fHelp)) return NullUniValue; - + if (fHelp || params.size() != 0) throw runtime_error( "resendwallettransactions\n" @@ -2323,7 +2323,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"