code: func dbIndexConnectBlock(dbTx database.Tx, indexer Indexer, block *btcutil.Block,
  	stxo []blockchain.SpentTxOut) error {
  
  	// Assert that the block being connected properly connects to the
  	// current tip of the index.
  	idxKey := indexer.Key()
  	curTipHash, _, err := dbFetchIndexerTip(dbTx, idxKey)
  	if err != nil {
  		return err
  	}
  	if !curTipHash.IsEqual(&block.MsgBlock().Header.PrevBlock) {
  		return AssertError(fmt.Sprintf("dbIndexConnectBlock must be "+
  			"called with a block that extends the current index "+
  			"tip (%s, tip %s, block %s)", indexer.Name(),
  			curTipHash, block.Hash()))
  	}
  
  	// Notify the indexer with the connected block so it can index it.
  	if err := indexer.ConnectBlock(dbTx, block, stxo); err != nil {
  		return err
  	}
  
  	// Update the current index tip.
  	return dbPutIndexerTip(dbTx, idxKey, block.Hash(), block.Height())
  }
docs: // dbIndexConnectBlock adds all of the index entries associated with the
  // given block using the provided indexer and updates the tip of the indexer
  // accordingly.  An error will be returned if the current tip for the indexer is
  // not the previous block for the passed block.