diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-06-19 15:10:04 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-06-25 10:31:35 +0200 |
commit | 84ce18ca9339901f65d77a5821eb65f771316558 (patch) | |
tree | 61012d3d9743d5ce8d0e9510c36f60856752c883 /src/bitcoin-cli.cpp | |
parent | 14f888ca804386b111b07e8988753d67f507ba30 (diff) |
Remove unnecessary dependencies for bitcoin-cli
This commit removes all the unnecessary dependencies (key, core,
netbase, sync, ...) from bitcoin-cli.
To do this it shards the chain parameters into BaseParams, which
contains just the RPC port and data directory (as used by utils and
bitcoin-cli) and Params, with the rest.
Diffstat (limited to 'src/bitcoin-cli.cpp')
-rw-r--r-- | src/bitcoin-cli.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 40b45415c4..db39df4b17 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -8,7 +8,7 @@ #include "rpcclient.h" #include "rpcprotocol.h" #include "ui_interface.h" /* for _(...) */ -#include "chainparams.h" +#include "chainparamsbase.h" #include <boost/filesystem/operations.hpp> @@ -60,12 +60,11 @@ static bool AppInitRPC(int argc, char* argv[]) fprintf(stderr,"Error reading configuration file: %s\n", e.what()); return false; } - // Check for -testnet or -regtest parameter (Params() calls are only valid after this clause) - if (!SelectParamsFromCommandLine()) { + // Check for -testnet or -regtest parameter (BaseParams() calls are only valid after this clause) + if (!SelectBaseParamsFromCommandLine()) { fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n"); return false; } - if (argc<2 || mapArgs.count("-?") || mapArgs.count("-help") || mapArgs.count("-version")) { std::string strUsage = _("Bitcoin Core RPC client version") + " " + FormatFullVersion() + "\n"; @@ -104,7 +103,7 @@ Object CallRPC(const string& strMethod, const Array& params) bool fWait = GetBoolArg("-rpcwait", false); // -rpcwait means try until server has started do { - bool fConnected = d.connect(GetArg("-rpcconnect", "127.0.0.1"), GetArg("-rpcport", itostr(Params().RPCPort()))); + bool fConnected = d.connect(GetArg("-rpcconnect", "127.0.0.1"), GetArg("-rpcport", itostr(BaseParams().RPCPort()))); if (fConnected) break; if (fWait) MilliSleep(1000); |