code: func (bc *BlockChain) Rollback(chain []common.Hash) {
  	bc.chainmu.Lock()
  	defer bc.chainmu.Unlock()
  
  	for i := len(chain) - 1; i >= 0; i-- {
  		hash := chain[i]
  
  		currentHeader := bc.hc.CurrentHeader()
  		if currentHeader.Hash() == hash {
  			bc.hc.SetCurrentHeader(bc.GetHeader(currentHeader.ParentHash, currentHeader.Number.Uint64()-1))
  		}
  		if currentFastBlock := bc.CurrentFastBlock(); currentFastBlock.Hash() == hash {
  			newFastBlock := bc.GetBlock(currentFastBlock.ParentHash(), currentFastBlock.NumberU64()-1)
  			bc.currentFastBlock.Store(newFastBlock)
  			rawdb.WriteHeadFastBlockHash(bc.db, newFastBlock.Hash())
  		}
  		if currentBlock := bc.CurrentBlock(); currentBlock.Hash() == hash {
  			newBlock := bc.GetBlock(currentBlock.ParentHash(), currentBlock.NumberU64()-1)
  			bc.currentBlock.Store(newBlock)
  			rawdb.WriteHeadBlockHash(bc.db, newBlock.Hash())
  		}
  	}
  }
docs: // Rollback is designed to remove a chain of links from the database that aren't
  // certain enough to be valid.