aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
authorBas van Kervel <basvankervel@ziggo.nl>2015-05-12 20:24:11 +0800
committerBas van Kervel <basvankervel@ziggo.nl>2015-05-12 20:24:11 +0800
commitb79dd188d916da7adbf448dc27b0c59a04e0938d (patch)
tree7980ae848a916171fbc65fb958eebdf0c98406dc /eth/backend.go
parentd82caa5ce38705d2dcdc2ba15c93df9325504e34 (diff)
downloadgo-tangerine-b79dd188d916da7adbf448dc27b0c59a04e0938d.tar.gz
go-tangerine-b79dd188d916da7adbf448dc27b0c59a04e0938d.tar.zst
go-tangerine-b79dd188d916da7adbf448dc27b0c59a04e0938d.zip
replaced several path.* with filepath.* which is platform independent
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go13
1 files changed, 6 insertions, 7 deletions
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)