mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-05 08:23:35 +00:00
`getFeeRates` coerced the remote response with `Math.ceil(data['1'] || 1)`.
`||` only catches falsy values, so a missing key was safe but a truthy
non-number — `{"1": "5"}`, `{"1": {"fee": 5}}`, what an API-version
mismatch produces — yielded NaN.
NaN then passed every downstream guard, because they are all `<` / `>=`
comparisons and every comparison with NaN is false: no change output was
added, the balance check passed, nothing threw, and the UI showed
"Fee 0" because `!NaN` is true. The wallet built a valid, broadcastable
transaction paying its entire balance to miners.
Sanitize each rate to a finite number in [1, 5000], and make `estimateFee`
throw on a non-finite rate rather than propagate NaN into the builder.