diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-22 01:18:19 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-22 01:18:19 +0800 |
commit | 7f85608f30a2e34005c8d15566849229c758c2f1 (patch) | |
tree | 7aeb9d8bdfda7ec10ea38688a96ed245028764ad /cmd/ethereum/admin.go | |
parent | 09766d1729f7530093aec7e9acd3e5339b2c2028 (diff) | |
parent | fcacfabe1959c4aff6a63cb4e275f65328660601 (diff) | |
download | dexon-7f85608f30a2e34005c8d15566849229c758c2f1.tar dexon-7f85608f30a2e34005c8d15566849229c758c2f1.tar.gz dexon-7f85608f30a2e34005c8d15566849229c758c2f1.tar.bz2 dexon-7f85608f30a2e34005c8d15566849229c758c2f1.tar.lz dexon-7f85608f30a2e34005c8d15566849229c758c2f1.tar.xz dexon-7f85608f30a2e34005c8d15566849229c758c2f1.tar.zst dexon-7f85608f30a2e34005c8d15566849229c758c2f1.zip |
Merge branch 'conversion' into develop
Diffstat (limited to 'cmd/ethereum/admin.go')
-rw-r--r-- | cmd/ethereum/admin.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/cmd/ethereum/admin.go b/cmd/ethereum/admin.go index 880a22c22..41aaf46d8 100644 --- a/cmd/ethereum/admin.go +++ b/cmd/ethereum/admin.go @@ -8,8 +8,8 @@ import ( "time" "github.com/ethereum/go-ethereum/cmd/utils" - "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rpc" "github.com/ethereum/go-ethereum/state" @@ -221,13 +221,10 @@ func (js *jsre) exportChain(call otto.FunctionCall) otto.Value { fmt.Println(err) return otto.FalseValue() } - - data := js.ethereum.ChainManager().Export() - if err := common.WriteFile(fn, data); err != nil { + if err := utils.ExportChain(js.ethereum.ChainManager(), fn); err != nil { fmt.Println(err) return otto.FalseValue() } - return otto.TrueValue() } @@ -239,7 +236,7 @@ func (js *jsre) dumpBlock(call otto.FunctionCall) otto.Value { block = js.ethereum.ChainManager().GetBlockByNumber(uint64(num)) } else if call.Argument(0).IsString() { hash, _ := call.Argument(0).ToString() - block = js.ethereum.ChainManager().GetBlock(common.Hex2Bytes(hash)) + block = js.ethereum.ChainManager().GetBlock(common.HexToHash(hash)) } else { fmt.Println("invalid argument for dump. Either hex string or number") } |