Delete current chain for reset

This commit is contained in:
obscuren 2014-12-23 14:50:04 +01:00
parent e2e3fa3d11
commit 1382e8d84b

View File

@ -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)