aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/geth/main.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-09-08 01:43:01 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-09-11 22:42:25 +0800
commitcdc2662c4098d68a7b450b9b9ff2688acbffcee4 (patch)
tree2dfb3b7365895203132bd6d1aa650b5a239b01eb /cmd/geth/main.go
parent2b339cbbd8bb475d2195d54a71dcced700003430 (diff)
downloaddexon-cdc2662c4098d68a7b450b9b9ff2688acbffcee4.tar
dexon-cdc2662c4098d68a7b450b9b9ff2688acbffcee4.tar.gz
dexon-cdc2662c4098d68a7b450b9b9ff2688acbffcee4.tar.bz2
dexon-cdc2662c4098d68a7b450b9b9ff2688acbffcee4.tar.lz
dexon-cdc2662c4098d68a7b450b9b9ff2688acbffcee4.tar.xz
dexon-cdc2662c4098d68a7b450b9b9ff2688acbffcee4.tar.zst
dexon-cdc2662c4098d68a7b450b9b9ff2688acbffcee4.zip
core: split out TD from database and all internals
Diffstat (limited to 'cmd/geth/main.go')
-rw-r--r--cmd/geth/main.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/cmd/geth/main.go b/cmd/geth/main.go
index f72f69791..ba753a493 100644
--- a/cmd/geth/main.go
+++ b/cmd/geth/main.go
@@ -528,17 +528,16 @@ func blockRecovery(ctx *cli.Context) {
var block *types.Block
if arg[0] == '#' {
- block = core.GetBlockByNumber(blockDb, common.String2Big(arg[1:]).Uint64())
+ block = core.GetBlock(blockDb, core.GetCanonicalHash(blockDb, common.String2Big(arg[1:]).Uint64()))
} else {
- block = core.GetBlockByHash(blockDb, common.HexToHash(arg))
+ block = core.GetBlock(blockDb, common.HexToHash(arg))
}
if block == nil {
glog.Fatalln("block not found. Recovery failed")
}
- err = core.WriteHead(blockDb, block)
- if err != nil {
+ if err = core.WriteHeadBlockHash(blockDb, block.Hash()); err != nil {
glog.Fatalln("block write err", err)
}
glog.Infof("Recovery succesful. New HEAD %x\n", block.Hash())