aboutsummaryrefslogtreecommitdiffstats
path: root/core/chain_manager.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-23 21:50:04 +0800
committerobscuren <geffobscura@gmail.com>2014-12-23 21:50:04 +0800
commit1382e8d84bf039e8f5588f07029255d0f901cf44 (patch)
treebf28e9480f64b60264d29cf55adb7164478859ff /core/chain_manager.go
parente2e3fa3d11b37c8a22ebafe9c02dfd8089ac4d51 (diff)
downloaddexon-1382e8d84bf039e8f5588f07029255d0f901cf44.tar
dexon-1382e8d84bf039e8f5588f07029255d0f901cf44.tar.gz
dexon-1382e8d84bf039e8f5588f07029255d0f901cf44.tar.bz2
dexon-1382e8d84bf039e8f5588f07029255d0f901cf44.tar.lz
dexon-1382e8d84bf039e8f5588f07029255d0f901cf44.tar.xz
dexon-1382e8d84bf039e8f5588f07029255d0f901cf44.tar.zst
dexon-1382e8d84bf039e8f5588f07029255d0f901cf44.zip
Delete current chain for reset
Diffstat (limited to 'core/chain_manager.go')
-rw-r--r--core/chain_manager.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/chain_manager.go b/core/chain_manager.go
index fe687e501..485c195d5 100644
--- a/core/chain_manager.go
+++ b/core/chain_manager.go
@@ -198,6 +198,10 @@ func (bc *ChainManager) Reset() {
bc.mu.Lock()
defer bc.mu.Unlock()
+ for block := bc.currentBlock; block != nil; block = bc.GetBlock(block.Header().ParentHash) {
+ ethutil.Config.Db.Delete(block.Hash())
+ }
+
// Prepare the genesis block
bc.write(bc.genesisBlock)
bc.insert(bc.genesisBlock)