aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-23 22:18:48 +0800
committerobscuren <geffobscura@gmail.com>2014-12-23 22:18:48 +0800
commit34f72ddb3d5a01d6c45c75604bc030c287d51fb2 (patch)
treed5a1b7e9de4e511b14671efb3eac6bd48eb7c775 /cmd
parent1382e8d84bf039e8f5588f07029255d0f901cf44 (diff)
downloadgo-tangerine-34f72ddb3d5a01d6c45c75604bc030c287d51fb2.tar
go-tangerine-34f72ddb3d5a01d6c45c75604bc030c287d51fb2.tar.gz
go-tangerine-34f72ddb3d5a01d6c45c75604bc030c287d51fb2.tar.bz2
go-tangerine-34f72ddb3d5a01d6c45c75604bc030c287d51fb2.tar.lz
go-tangerine-34f72ddb3d5a01d6c45c75604bc030c287d51fb2.tar.xz
go-tangerine-34f72ddb3d5a01d6c45c75604bc030c287d51fb2.tar.zst
go-tangerine-34f72ddb3d5a01d6c45c75604bc030c287d51fb2.zip
Decode from stream directly
Diffstat (limited to 'cmd')
-rw-r--r--cmd/ethereum/main.go5
1 files changed, 2 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
}