aboutsummaryrefslogtreecommitdiffstats
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
parente2e3fa3d11b37c8a22ebafe9c02dfd8089ac4d51 (diff)
downloadgo-tangerine-1382e8d84bf039e8f5588f07029255d0f901cf44.tar.gz
go-tangerine-1382e8d84bf039e8f5588f07029255d0f901cf44.tar.zst
go-tangerine-1382e8d84bf039e8f5588f07029255d0f901cf44.zip
Delete current chain for reset
-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)