diff options
-rw-r--r-- | cmd/ethereum/main.go | 5 | ||||
-rw-r--r-- | ethdb/database.go | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index f16244a2d..12e22a438 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -18,7 +18,6 @@ package main import ( - "bytes" "fmt" "os" "runtime" @@ -120,13 +119,13 @@ func main() { if len(ImportChain) > 0 { clilogger.Infof("importing chain '%s'\n", ImportChain) - c, err := ethutil.ReadAllFile(ImportChain) + fh, err := os.OpenFile(ImportChain, os.O_RDONLY, os.ModePerm) if err != nil { clilogger.Infoln(err) return } var chain types.Blocks - if err := rlp.Decode(bytes.NewReader([]byte(c)), &chain); err != nil { + if err := rlp.Decode(fh, &chain); err != nil { clilogger.Infoln(err) return } diff --git a/ethdb/database.go b/ethdb/database.go index 19aa83466..47ddec9c0 100644 --- a/ethdb/database.go +++ b/ethdb/database.go @@ -71,6 +71,10 @@ func (self *LDBDatabase) NewIterator() iterator.Iterator { return self.db.NewIterator(nil, nil) } +func (self *LDBDatabase) Write(batch *leveldb.Batch) error { + return self.db.Write(batch, nil) +} + func (self *LDBDatabase) Close() { // Close the leveldb database self.db.Close() |