Skip to content

bug(bitcoin-da): validate_txs_fee_rate panics on Amount subtraction underflow with malformed inputs #3264

@amathxbt

Description

@amathxbt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions