code: func (idx *TxIndex) DisconnectBlock(dbTx database.Tx, block *btcutil.Block,
  	stxos []blockchain.SpentTxOut) error {
  
  	// Remove all of the transactions in the block from the index.
  	if err := dbRemoveTxIndexEntries(dbTx, block); err != nil {
  		return err
  	}
  
  	// Remove the block ID index entry for the block being disconnected and
  	// decrement the current internal block ID to account for it.
  	if err := dbRemoveBlockIDIndexEntry(dbTx, block.Hash()); err != nil {
  		return err
  	}
  	idx.curBlockID--
  	return nil
  }
docs: // DisconnectBlock is invoked by the index manager when a block has been
  // disconnected from the main chain.  This indexer removes the
  // hash-to-transaction mapping for every transaction in the block.
  //
  // This is part of the Indexer interface.