code: func calcInputValueAge(tx *wire.MsgTx, utxoView *blockchain.UtxoViewpoint, nextBlockHeight int32) float64 {
  	var totalInputAge float64
  	for _, txIn := range tx.TxIn {
  		// Don't attempt to accumulate the total input age if the
  		// referenced transaction output doesn't exist.
  		entry := utxoView.LookupEntry(txIn.PreviousOutPoint)
  		if entry != nil && !entry.IsSpent() {
  			// Inputs with dependencies currently in the mempool
  			// have their block height set to a special constant.
  			// Their input age should computed as zero since their
  			// parent hasn't made it into a block yet.
  			var inputAge int32
  			originHeight := entry.BlockHeight()
  			if originHeight == UnminedHeight {
  				inputAge = 0
  			} else {
  				inputAge = nextBlockHeight - originHeight
  			}
  
  			// Sum the input value times age.
  			inputValue := entry.Amount()
  			totalInputAge += float64(inputValue * int64(inputAge))
  		}
  	}
  
  	return totalInputAge
  }
docs: // calcInputValueAge is a helper function used to calculate the input age of
  // a transaction.  The input age for a txin is the number of confirmations
  // since the referenced txout multiplied by its output value.  The total input
  // age is the sum of this value for each txin.  Any inputs to the transaction
  // which are currently in the mempool and hence not mined into a block yet,
  // contribute no additional input age to the transaction.