code: func (bc *BlockChain) ResetWithGenesisBlock(genesis *types.Block) error {
  	// Dump the entire block chain and purge the caches
  	if err := bc.SetHead(0); err != nil {
  		return err
  	}
  	bc.chainmu.Lock()
  	defer bc.chainmu.Unlock()
  
  	// Prepare the genesis block and reinitialise the chain
  	if err := bc.hc.WriteTd(genesis.Hash(), genesis.NumberU64(), genesis.Difficulty()); err != nil {
  		log.Crit("Failed to write genesis block TD", "err", err)
  	}
  	rawdb.WriteBlock(bc.db, genesis)
  
  	bc.genesisBlock = genesis
  	bc.insert(bc.genesisBlock)
  	bc.currentBlock.Store(bc.genesisBlock)
  	bc.hc.SetGenesis(bc.genesisBlock.Header())
  	bc.hc.SetCurrentHeader(bc.genesisBlock.Header())
  	bc.currentFastBlock.Store(bc.genesisBlock)
  
  	return nil
  }
docs: // ResetWithGenesisBlock purges the entire blockchain, restoring it to the
  // specified genesis state.