From 347dbe7fde3ba70a53ac4258737fe25ab39fd96d Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 2 Nov 2026 15:45:22 -0700 Subject: Lightning send: the max routing fee field is a number, so the total adds it instead of gluing its digits onto the amount. "The max fee reserve paying a lightning invoice is not in sats. Putting a 1 makes it like 10 million sats or something" (mrecheese via Adam, 2026-11-02): the input had no type, so Svelte bound the typed text and amount + maxfee + ourfee concatenated — a 10,000-sat send with a 1 typed in read as ⚡️10000110. The server already parsed the fee as an integer, so only the shown total was wrong. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01VMan6TFgisGKUDhdStLUvs --- src/routes/(app)/send/lightning/[payreq]/[...memo]/+page.svelte | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/routes') diff --git a/src/routes/(app)/send/lightning/[payreq]/[...memo]/+page.svelte b/src/routes/(app)/send/lightning/[payreq]/[...memo]/+page.svelte index 7b42a42d..5f64edd1 100644 --- a/src/routes/(app)/send/lightning/[payreq]/[...memo]/+page.svelte +++ b/src/routes/(app)/send/lightning/[payreq]/[...memo]/+page.svelte @@ -39,7 +39,10 @@ ); $effect(() => (maxfee = quoted ? fee : fallback)); - let total = $derived((amount || 0) + (maxfee || 0) + (ourfee || 0)); + // maxfee comes back from the input as whatever was typed: as a number + // here, so the total adds it rather than gluing the digits on ("1" made + // a 10,000-sat send read as ten million) + let total = $derived((Number(amount) || 0) + (Number(maxfee) || 0) + (Number(ourfee) || 0)); // Server-side messages worth showing verbatim: a balance shortfall, or the // pre-flight check that the max fee is below what routing now costs. @@ -162,6 +165,10 @@ -- cgit v1.2.3