Skip to content

fix: clamp ideal_fee to 0.0 in LowestFee::bound to prevent f32 rounding panic - #71

Open
Arowolokehinde wants to merge 1 commit into
bitcoindevkit:masterfrom
Arowolokehinde:fix/lowest-fee-bound-f32-panic
Open

fix: clamp ideal_fee to 0.0 in LowestFee::bound to prevent f32 rounding panic#71
Arowolokehinde wants to merge 1 commit into
bitcoindevkit:masterfrom
Arowolokehinde:fix/lowest-fee-bound-f32-panic

Conversation

@Arowolokehinde

Copy link
Copy Markdown

f32 rounding causes the fractional relaxation to land slightly below zero on valid inputs, triggering assert!(ideal_fee >= 0.0). Clamping to 0.0 is always admissible since fees are never negative.
Added a regression test using the concrete values from the issue report.
Closes #57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LowestFee::bound panics on assert!(ideal_fee >= 0.0) due to f32 rounding

1 participant