diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-23 22:37:03 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-23 22:37:03 +0800 |
commit | 1054c155db8ac59b97b81fa7a7a20f2239eb1e82 (patch) | |
tree | b826dff6b28b9daaf585f1db8f30309117f882d0 /cmd/ethereum | |
parent | 7d2353f24dad8bba8914b4014117fe73248c211c (diff) | |
download | dexon-1054c155db8ac59b97b81fa7a7a20f2239eb1e82.tar dexon-1054c155db8ac59b97b81fa7a7a20f2239eb1e82.tar.gz dexon-1054c155db8ac59b97b81fa7a7a20f2239eb1e82.tar.bz2 dexon-1054c155db8ac59b97b81fa7a7a20f2239eb1e82.tar.lz dexon-1054c155db8ac59b97b81fa7a7a20f2239eb1e82.tar.xz dexon-1054c155db8ac59b97b81fa7a7a20f2239eb1e82.tar.zst dexon-1054c155db8ac59b97b81fa7a7a20f2239eb1e82.zip |
Moved import to utils
Diffstat (limited to 'cmd/ethereum')
-rw-r--r-- | cmd/ethereum/main.go | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index d704140d4..2e0a5663a 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -26,7 +26,6 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/logger" - "github.com/ethereum/go-ethereum/rlp" ) const ( @@ -118,26 +117,11 @@ func main() { } if len(ImportChain) > 0 { - clilogger.Infof("importing chain '%s'\n", ImportChain) - fh, err := os.OpenFile(ImportChain, os.O_RDONLY, os.ModePerm) + err := utils.ImportChain(ethereum, ImportChain) if err != nil { clilogger.Infoln(err) - return } - defer fh.Close() - - var chain types.Blocks - if err := rlp.Decode(fh, &chain); err != nil { - clilogger.Infoln(err) - return - } - - ethereum.ChainManager().Reset() - if err := ethereum.ChainManager().InsertChain(chain); err != nil { - clilogger.Infoln(err) - return - } - clilogger.Infof("imported %d blocks\n", len(chain)) + return } // better reworked as cases |