From 1382e8d84bf039e8f5588f07029255d0f901cf44 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 23 Dec 2014 14:50:04 +0100 Subject: [PATCH] Delete current chain for reset --- core/chain_manager.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/chain_manager.go b/core/chain_manager.go index fe687e5015..485c195d5e 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)