diff options
| author | Adam Soltys <[email protected]> | 2026-08-28 19:30:11 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-28 19:30:11 -0700 |
| commit | 7721a68f6202db562e68226f06319304bb180970 (patch) | |
| tree | a80611b147e64f940df855fec308bb752ee16e36 /src/features | |
| parent | 12ecbf2bcdd59b6c3a2714c69240cb3be65b7e3e (diff) | |
| download | coinosv3-7721a68f6202db562e68226f06319304bb180970.tar.gz coinosv3-7721a68f6202db562e68226f06319304bb180970.zip | |
No exit leaves without fare money: starting one now requires Savings to cover the estimated hop fees (named in the refusal), and a mid-flight stall says exactly how many sats the next step needs and that it resumes on its own
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 | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/features/ark.js b/src/features/ark.js index 14ac9c1..81e3351 100644 --- a/src/features/ark.js +++ b/src/features/ark.js @@ -1597,6 +1597,13 @@ export function arkFeature(ctx) { const mgr = await connectArk(); const spendables = mgr.vtxos().filter((v) => v.state === 'spendable'); if (!spendables.length) throw new Error(t('arkNotConnected')); + // Fees are paid hop by hop from Savings as the exit unrolls — an exit + // that can't fund its hops just stalls at step zero. Refuse to start + // one Savings can't carry, with the number on the table. + const feeEst = estimateExitFeeSat(mgr); + if ((wallet.spendable || 0) < feeEst) { + throw new Error(t('arkExitFeeShort', { need: fmtAmount(feeEst), have: fmtAmount(wallet.spendable || 0) })); + } for (const v of spendables) mgr.startExit(v.id); toast(t('arkExitStarted', { n: spendables.length })); driveExits(mgr).catch(() => {}); @@ -1650,7 +1657,7 @@ export function arkFeature(ctx) { mgr._save(); return; } catch { - const e = new Error(t('arkExitNoFeeCoin')); + const e = new Error(t('arkExitNoFeeCoin', { need: fmtAmount(Math.max(294, feeSat)) })); e.actionable = true; throw e; } |
