diff options
| author | Adam Soltys <[email protected]> | 2026-08-28 19:33:29 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-28 19:33:29 -0700 |
| commit | 69d7b3d9411741d6b77b59bc35059cc56cc4fb61 (patch) | |
| tree | 6f1990d794df2abde3328b274fb1c56e027523d1 /src/features | |
| parent | 7721a68f6202db562e68226f06319304bb180970 (diff) | |
| download | coinosv3-69d7b3d9411741d6b77b59bc35059cc56cc4fb61.tar.gz coinosv3-69d7b3d9411741d6b77b59bc35059cc56cc4fb61.zip | |
An exit dearer than its cargo is not an option: when the trustless road would cost more than it moves, the fallback says so plainly and points at Lightning — the road with no mining fees — instead of offering an 8,486-sat ticket for 928 sats of passenger
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019eA8JRq9Wr7z2fRQk99HLi
Diffstat (limited to 'src/features')
| -rw-r--r-- | src/features/ark.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/features/ark.js b/src/features/ark.js index 81e3351..269cfb9 100644 --- a/src/features/ark.js +++ b/src/features/ark.js @@ -1874,6 +1874,14 @@ export function arkFeature(ctx) { if (!ui.arkError || ui.arkBusy === 'offboard' || !ark) return null; let feeEst = 0; try { feeEst = estimateExitFeeSat(ark); } catch {} + const balance = arkBalance()?.spendableSat || 0; + // A trustless exit that costs more than it moves isn't an option, + // it's a trap — say so, and point at the road that actually fits a + // small balance: Lightning carries no mining fees at all. + if (feeEst >= balance) { + return h('div', { class: 'col', style: 'gap:8px;border-top:1px solid var(--border,rgba(128,128,128,.2));padding-top:10px' }, + h('div', { class: 'small muted' }, t('arkUniUneconomical', { fee: fmtAmount(feeEst), n: fmtAmount(balance) }))); + } const savings = wallet.spendable || 0; const short = savings < feeEst; return h('div', { class: 'col', style: 'gap:8px;border-top:1px solid var(--border,rgba(128,128,128,.2));padding-top:10px' }, |
