mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-19 14:29:27 +00:00
Delete current chain for reset
This commit is contained in:
parent
e2e3fa3d11
commit
1382e8d84b
1 changed files with 4 additions and 0 deletions
|
|
@ -198,6 +198,10 @@ func (bc *ChainManager) Reset() {
|
||||||
bc.mu.Lock()
|
bc.mu.Lock()
|
||||||
defer bc.mu.Unlock()
|
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
|
// Prepare the genesis block
|
||||||
bc.write(bc.genesisBlock)
|
bc.write(bc.genesisBlock)
|
||||||
bc.insert(bc.genesisBlock)
|
bc.insert(bc.genesisBlock)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue