This commit is contained in:
Gustav Simonsson 2015-09-15 14:25:24 +00:00
commit 82c86a9e0a

View file

@ -226,7 +226,6 @@ func (bc *ChainManager) recover() bool {
func (bc *ChainManager) setLastState() error { func (bc *ChainManager) setLastState() error {
head := GetHeadBlockHash(bc.chainDb) head := GetHeadBlockHash(bc.chainDb)
if head != (common.Hash{}) {
block := bc.GetBlock(head) block := bc.GetBlock(head)
if block != nil { if block != nil {
bc.currentBlock = block bc.currentBlock = block
@ -238,9 +237,6 @@ func (bc *ChainManager) setLastState() error {
glog.Fatalf("Recover failed. Please report") glog.Fatalf("Recover failed. Please report")
} }
} }
} else {
bc.Reset()
}
bc.td = bc.GetTd(bc.currentBlock.Hash()) bc.td = bc.GetTd(bc.currentBlock.Hash())
bc.currentGasLimit = CalcGasLimit(bc.currentBlock) bc.currentGasLimit = CalcGasLimit(bc.currentBlock)
@ -251,11 +247,6 @@ func (bc *ChainManager) setLastState() error {
return nil return nil
} }
// Reset purges the entire blockchain, restoring it to its genesis state.
func (bc *ChainManager) Reset() {
bc.ResetWithGenesisBlock(bc.genesisBlock)
}
// ResetWithGenesisBlock purges the entire blockchain, restoring it to the // ResetWithGenesisBlock purges the entire blockchain, restoring it to the
// specified genesis state. // specified genesis state.
func (bc *ChainManager) ResetWithGenesisBlock(genesis *types.Block) { func (bc *ChainManager) ResetWithGenesisBlock(genesis *types.Block) {