pub fn check_tx_inputs<U>(
tx: &Transaction,
utxo_set: &U,
height: u64,
) -> Result<(ValidationResult, i64), ConsensusError>where
U: UtxoLookup,Expand description
CheckTxInputs: ๐ฏ๐ณ ร ๐ฐ๐ฎ ร โ โ {valid, invalid} ร โค
For transaction tx with UTXO set us at height h:
- If tx is coinbase: return (valid, 0)
- If tx is not coinbase: โi โ ins: ยฌi.prevout.IsNull() (Orange Paper Section 5.1, rule 6)
- Let total_in = ฮฃแตข us(i.prevout).value
- Let total_out = ฮฃโ o.value
- If total_in < total_out: return (invalid, 0)
- Return (valid, total_in - total_out)