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.
This commit is contained in:
Wladimir J. van der Laan
2014-06-19 15:10:04 +02:00
parent 14f888ca80
commit 84ce18ca93
19 changed files with 232 additions and 89 deletions

View File

@@ -5,7 +5,7 @@
#include "util.h"
#include "chainparams.h"
#include "chainparamsbase.h"
#include "sync.h"
#include "ui_interface.h"
#include "uint256.h"
@@ -918,7 +918,7 @@ boost::filesystem::path GetDefaultDataDir()
#endif
}
static boost::filesystem::path pathCached[CChainParams::MAX_NETWORK_TYPES+1];
static boost::filesystem::path pathCached[CBaseChainParams::MAX_NETWORK_TYPES+1];
static CCriticalSection csPathCached;
const boost::filesystem::path &GetDataDir(bool fNetSpecific)
@@ -927,8 +927,8 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific)
LOCK(csPathCached);
int nNet = CChainParams::MAX_NETWORK_TYPES;
if (fNetSpecific) nNet = Params().NetworkID();
int nNet = CBaseChainParams::MAX_NETWORK_TYPES;
if (fNetSpecific) nNet = BaseParams().NetworkID();
fs::path &path = pathCached[nNet];
@@ -947,7 +947,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific)
path = GetDefaultDataDir();
}
if (fNetSpecific)
path /= Params().DataDir();
path /= BaseParams().DataDir();
fs::create_directories(path);
@@ -956,7 +956,7 @@ const boost::filesystem::path &GetDataDir(bool fNetSpecific)
void ClearDatadirCache()
{
std::fill(&pathCached[0], &pathCached[CChainParams::MAX_NETWORK_TYPES+1],
std::fill(&pathCached[0], &pathCached[CBaseChainParams::MAX_NETWORK_TYPES+1],
boost::filesystem::path());
}