|
|
@ -18,7 +18,6 @@ |
|
|
|
package main |
|
|
|
package main |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
"bytes" |
|
|
|
|
|
|
|
"fmt" |
|
|
|
"fmt" |
|
|
|
"os" |
|
|
|
"os" |
|
|
|
"runtime" |
|
|
|
"runtime" |
|
|
@ -120,13 +119,13 @@ func main() { |
|
|
|
|
|
|
|
|
|
|
|
if len(ImportChain) > 0 { |
|
|
|
if len(ImportChain) > 0 { |
|
|
|
clilogger.Infof("importing chain '%s'\n", ImportChain) |
|
|
|
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 { |
|
|
|
if err != nil { |
|
|
|
clilogger.Infoln(err) |
|
|
|
clilogger.Infoln(err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
var chain types.Blocks |
|
|
|
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) |
|
|
|
clilogger.Infoln(err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|