From 1307f8930283393fcf987cfa7e5cfa054676396a Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 5 Aug 2026 11:56:53 -0700 Subject: Spending trusts its own ledger: gifts read persisted ark state, and Savings keeps its pending line to itself Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01M5kFodm9azZJVTQxnkDdKe --- src/features/gifts.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/features/gifts.js') diff --git a/src/features/gifts.js b/src/features/gifts.js index 0543030..e3025d3 100644 --- a/src/features/gifts.js +++ b/src/features/gifts.js @@ -412,7 +412,15 @@ export function giftsFeature(ctx) { const avail = info ? info.spendableSat : 0; const amt = ui.giftMax ? avail : parseAmount(ui.giftAmount, getUnit()); if (!amt || amt < 1) { ui.giftError = t('giftAmountInvalid', { n: fmtAmount(1) + ' ' + unitLabel() }); render(); return; } - if (amt > avail) { ui.giftError = t('giftExceedsBalance'); render(); return; } + if (amt > avail) { + // The headline Spending number includes settling coins; when those are + // what's missing, say so instead of disputing the user's own balance. + const pend = (info && info.pendingSat) || 0; + ui.giftError = amt <= avail + pend + ? t('giftSettling', { n: fmtAmount(pend) + ' ' + unitLabel() }) + : t('giftExceedsBalance'); + render(); return; + } ui.busy = true; ui.giftError = ''; render(); try { const g = await hook('arkGiftCreate', amt); -- cgit v1.2.3