diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-12 23:23:46 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-05-12 23:23:46 +0800 |
commit | 58d6ec689ff44232cd5d6a7cbbaad2d7a2cb44bd (patch) | |
tree | a5bfb1a0ade11c7f68d0322b9773e8c46571c455 /eth | |
parent | f87094b660c95b547486e7439620e68f3d59c45f (diff) | |
parent | 899df30c24c85ca0b2dadd4cbb251a4ec5ca1a75 (diff) | |
download | dexon-58d6ec689ff44232cd5d6a7cbbaad2d7a2cb44bd.tar dexon-58d6ec689ff44232cd5d6a7cbbaad2d7a2cb44bd.tar.gz dexon-58d6ec689ff44232cd5d6a7cbbaad2d7a2cb44bd.tar.bz2 dexon-58d6ec689ff44232cd5d6a7cbbaad2d7a2cb44bd.tar.lz dexon-58d6ec689ff44232cd5d6a7cbbaad2d7a2cb44bd.tar.xz dexon-58d6ec689ff44232cd5d6a7cbbaad2d7a2cb44bd.tar.zst dexon-58d6ec689ff44232cd5d6a7cbbaad2d7a2cb44bd.zip |
Merge pull request #933 from bas-vk/issue928
replaced path with platform aware filepath module
Diffstat (limited to 'eth')
-rw-r--r-- | eth/backend.go | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/eth/backend.go b/eth/backend.go index 46ef64a8a..7960a0e61 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -7,7 +7,6 @@ import ( "io/ioutil" "math/big" "os" - "path" "path/filepath" "strings" "time" @@ -145,7 +144,7 @@ func (cfg *Config) nodeKey() (*ecdsa.PrivateKey, error) { return cfg.NodeKey, nil } // use persistent key if present - keyfile := path.Join(cfg.DataDir, "nodekey") + keyfile := filepath.Join(cfg.DataDir, "nodekey") key, err := crypto.LoadECDSA(keyfile) if err == nil { return key, nil @@ -215,25 +214,25 @@ func New(config *Config) (*Ethereum, error) { if newdb == nil { newdb = func(path string) (common.Database, error) { return ethdb.NewLDBDatabase(path) } } - blockDb, err := newdb(path.Join(config.DataDir, "blockchain")) + blockDb, err := newdb(filepath.Join(config.DataDir, "blockchain")) if err != nil { return nil, fmt.Errorf("blockchain db err: %v", err) } - stateDb, err := newdb(path.Join(config.DataDir, "state")) + stateDb, err := newdb(filepath.Join(config.DataDir, "state")) if err != nil { return nil, fmt.Errorf("state db err: %v", err) } - extraDb, err := newdb(path.Join(config.DataDir, "extra")) + extraDb, err := newdb(filepath.Join(config.DataDir, "extra")) if err != nil { return nil, fmt.Errorf("extra db err: %v", err) } - nodeDb := path.Join(config.DataDir, "nodes") + nodeDb := filepath.Join(config.DataDir, "nodes") // Perform database sanity checks d, _ := blockDb.Get([]byte("ProtocolVersion")) protov := int(common.NewValue(d).Uint()) if protov != config.ProtocolVersion && protov != 0 { - path := path.Join(config.DataDir, "blockchain") + path := filepath.Join(config.DataDir, "blockchain") return nil, fmt.Errorf("Database version mismatch. Protocol(%d / %d). `rm -rf %s`", protov, config.ProtocolVersion, path) } saveProtocolVersion(blockDb, config.ProtocolVersion) |