code: func (idx *AddrIndex) DisconnectBlock(dbTx database.Tx, block *btcutil.Block,
  	stxos []blockchain.SpentTxOut) error {
  
  	// Build all of the address to transaction mappings in a local map.
  	addrsToTxns := make(writeIndexData)
  	idx.indexBlock(addrsToTxns, block, stxos)
  
  	// Remove all of the index entries for each address.
  	bucket := dbTx.Metadata().Bucket(addrIndexKey)
  	for addrKey, txIdxs := range addrsToTxns {
  		err := dbRemoveAddrIndexEntries(bucket, addrKey, len(txIdxs))
  		if err != nil {
  			return err
  		}
  	}
  
  	return nil
  }
docs: // DisconnectBlock is invoked by the index manager when a block has been
  // disconnected from the main chain.  This indexer removes the address mappings
  // each transaction in the block involve.
  //
  // This is part of the Indexer interface.