From 5c6382b276f89b72a5d135d35cf81d0e92e00a03 Mon Sep 17 00:00:00 2001 From: Wisdom Arerosuoghene Date: Sat, 24 Aug 2019 00:40:28 +0100 Subject: [PATCH 1/2] deprecate unused dcrstakepool datadir config option --- config.go | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/config.go b/config.go index fbc62e7c..5175f58a 100644 --- a/config.go +++ b/config.go @@ -29,7 +29,6 @@ const ( defaultBaseURL = "http://127.0.0.1:8000" defaultClosePoolMsg = "The voting service is temporarily closed to new signups." defaultConfigFilename = "dcrstakepool.conf" - defaultDataDirname = "data" defaultLogLevel = "info" defaultLogDirname = "logs" defaultLogFilename = "dcrstakepool.log" @@ -53,7 +52,6 @@ const ( var ( dcrstakepoolHomeDir = dcrutil.AppDataDir("dcrstakepool", false) defaultConfigFile = filepath.Join(dcrstakepoolHomeDir, defaultConfigFilename) - defaultDataDir = filepath.Join(dcrstakepoolHomeDir, defaultDataDirname) defaultLogDir = filepath.Join(dcrstakepoolHomeDir, defaultLogDirname) coldWalletFeeKey *hdkeychain.ExtendedKey votingWalletVoteKey *hdkeychain.ExtendedKey @@ -69,7 +67,7 @@ var runServiceCommand func(string) error type config struct { ShowVersion bool `short:"V" long:"version" description:"Display version information and exit"` ConfigFile string `short:"C" long:"configfile" description:"Path to configuration file"` - DataDir string `short:"b" long:"datadir" description:"Directory to store data"` + DataDir string `short:"b" long:"datadir" description:"Deprecated. Unused, do not set."` LogDir string `long:"logdir" description:"Directory to log output."` Listen string `long:"listen" description:"Listen for connections on the specified interface/port (default all interfaces port: 9113, testnet: 19113)"` TestNet bool `long:"testnet" description:"Use the test network"` @@ -320,7 +318,6 @@ func loadConfig() (*config, []string, error) { ClosePoolMsg: defaultClosePoolMsg, ConfigFile: defaultConfigFile, DebugLevel: defaultLogLevel, - DataDir: defaultDataDir, LogDir: defaultLogDir, CookieSecure: defaultCookieSecure, DBHost: defaultDBHost, @@ -450,15 +447,6 @@ func loadConfig() (*config, []string, error) { return nil, nil, err } - // Append the network type to the data directory so it is "namespaced" - // per network. In addition to the block database, there are other - // pieces of data that are saved to disk such as address manager state. - // All data is specific to a network, so namespacing the data directory - // means each individual piece of serialized data does not have to - // worry about changing names per network and such. - cfg.DataDir = cleanAndExpandPath(cfg.DataDir) - cfg.DataDir = filepath.Join(cfg.DataDir, netName(activeNetParams)) - // Append the network type to the log directory so it is "namespaced" // per network in the same fashion as the data directory. cfg.LogDir = cleanAndExpandPath(cfg.LogDir) @@ -633,6 +621,11 @@ func loadConfig() (*config, []string, error) { } // Warn about deprecated config items if they have been set + if cfg.DataDir != "" { + str := "%s: Config datadir is deprecated. Please remove from your config file" + log.Warnf(str, funcName) + } + if cfg.EnableStakepoold { str := "%s: Config enablestakepoold is deprecated. Please remove from your config file" log.Warnf(str, funcName) From c8cdc7ecf87b76248118b61b4e01dd87efbfffb7 Mon Sep 17 00:00:00 2001 From: Wisdom Arerosuoghene Date: Mon, 26 Aug 2019 17:42:05 +0100 Subject: [PATCH 2/2] remove datadir config setting from test harness --- harness.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/harness.sh b/harness.sh index 5727df01..3a8c87dd 100755 --- a/harness.sh +++ b/harness.sh @@ -145,7 +145,6 @@ echo "" echo "Writing config for dcrstakepool" mkdir -p "${NODES_ROOT}/dcrstakepool" cat > "${NODES_ROOT}/dcrstakepool/dcrstakepool.conf" <