diff options
author | obscuren <geffobscura@gmail.com> | 2014-12-23 21:50:04 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-12-23 21:50:04 +0800 |
commit | 1382e8d84bf039e8f5588f07029255d0f901cf44 (patch) | |
tree | bf28e9480f64b60264d29cf55adb7164478859ff /core | |
parent | e2e3fa3d11b37c8a22ebafe9c02dfd8089ac4d51 (diff) | |
download | dexon-1382e8d84bf039e8f5588f07029255d0f901cf44.tar.gz dexon-1382e8d84bf039e8f5588f07029255d0f901cf44.tar.zst dexon-1382e8d84bf039e8f5588f07029255d0f901cf44.zip |
Delete current chain for reset
Diffstat (limited to 'core')
-rw-r--r-- | core/chain_manager.go | 4 |
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) |