code: func spendTransaction(utxoView *blockchain.UtxoViewpoint, tx *btcutil.Tx, height int32) error {
  	for _, txIn := range tx.MsgTx().TxIn {
  		entry := utxoView.LookupEntry(txIn.PreviousOutPoint)
  		if entry != nil {
  			entry.Spend()
  		}
  	}
  
  	utxoView.AddTxOuts(tx, height)
  	return nil
  }
docs: // spendTransaction updates the passed view by marking the inputs to the passed
  // transaction as spent.  It also adds all outputs in the passed transaction
  // which are not provably unspendable as available unspent transaction outputs.