From b79dd188d916da7adbf448dc27b0c59a04e0938d Mon Sep 17 00:00:00 2001 From: Bas van Kervel Date: Tue, 12 May 2015 14:24:11 +0200 Subject: replaced several path.* with filepath.* which is platform independent --- eth/backend.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'eth/backend.go') diff --git a/eth/backend.go b/eth/backend.go index 80da30086..433abab7f 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 @@ -214,25 +213,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) -- cgit