code: func (idx *AddrIndex) indexBlock(data writeIndexData, block *btcutil.Block,
  	stxos []blockchain.SpentTxOut) {
  
  	stxoIndex := 0
  	for txIdx, tx := range block.Transactions() {
  		// Coinbases do not reference any inputs.  Since the block is
  		// required to have already gone through full validation, it has
  		// already been proven on the first transaction in the block is
  		// a coinbase.
  		if txIdx != 0 {
  			for range tx.MsgTx().TxIn {
  				// We'll access the slice of all the
  				// transactions spent in this block properly
  				// ordered to fetch the previous input script.
  				pkScript := stxos[stxoIndex].PkScript
  				idx.indexPkScript(data, pkScript, txIdx)
  
  				// With an input indexed, we'll advance the
  				// stxo coutner.
  				stxoIndex++
  			}
  		}
  
  		for _, txOut := range tx.MsgTx().TxOut {
  			idx.indexPkScript(data, txOut.PkScript, txIdx)
  		}
  	}
  }
docs: // indexBlock extract all of the standard addresses from all of the transactions
  // in the passed block and maps each of them to the associated transaction using
  // the passed map.