diff options
author | Felix Lange <fjl@twurst.com> | 2016-11-11 13:13:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-11 13:13:16 +0800 |
commit | 9eb6f627fa9e08573580fc5915e23d332a36071b (patch) | |
tree | 711a6f608e074df8ab514f1e269dac457ddc1fdc /node/config.go | |
parent | 80ea44c485c42032aa954f2a8580e3afb4aa5339 (diff) | |
parent | 8247bccf71351812cd60179c3ef0f9d596f117c1 (diff) | |
download | dexon-9eb6f627fa9e08573580fc5915e23d332a36071b.tar dexon-9eb6f627fa9e08573580fc5915e23d332a36071b.tar.gz dexon-9eb6f627fa9e08573580fc5915e23d332a36071b.tar.bz2 dexon-9eb6f627fa9e08573580fc5915e23d332a36071b.tar.lz dexon-9eb6f627fa9e08573580fc5915e23d332a36071b.tar.xz dexon-9eb6f627fa9e08573580fc5915e23d332a36071b.tar.zst dexon-9eb6f627fa9e08573580fc5915e23d332a36071b.zip |
Merge pull request #3247 from fjl/bzzd
cmd: add swarm command line tools
Diffstat (limited to 'node/config.go')
-rw-r--r-- | node/config.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/node/config.go b/node/config.go index 8af9215a0..dbefcb8a5 100644 --- a/node/config.go +++ b/node/config.go @@ -268,7 +268,7 @@ func (c *Config) name() string { return c.Name } -// These resources are resolved differently for the "geth" and "geth-testnet" instances. +// These resources are resolved differently for "geth" instances. var isOldGethResource = map[string]bool{ "chaindata": true, "nodes": true, @@ -297,7 +297,14 @@ func (c *Config) resolvePath(path string) string { return oldpath } } - return filepath.Join(c.DataDir, c.name(), path) + return filepath.Join(c.instanceDir(), path) +} + +func (c *Config) instanceDir() string { + if c.DataDir == "" { + return "" + } + return filepath.Join(c.DataDir, c.name()) } // NodeKey retrieves the currently configured private key of the node, checking |