Description
validate_txs_fee_rate in fee.rs uses the - operator on bitcoin::Amount. If output_amount > input_amount (malformed input), this panics in debug builds and wraps silently in release, bypassing the FeeCalculation error return.
Expected behaviour
Use checked_sub so an underflow is treated as a fee-validation failure instead of a panic.
Description
validate_txs_fee_rateinfee.rsuses the-operator onbitcoin::Amount. Ifoutput_amount > input_amount(malformed input), this panics in debug builds and wraps silently in release, bypassing theFeeCalculationerror return.Expected behaviour
Use
checked_subso an underflow is treated as a fee-validation failure instead of a panic.