diff options
| author | Adam Soltys <[email protected]> | 2026-08-28 19:26:40 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-28 19:26:40 -0700 |
| commit | a8e4358fd2b869a9471e265b11c1bda18764dfbe (patch) | |
| tree | 59bfca761d4e871c2d4f21a5d7b6091f79020b73 /src/features | |
| parent | e082396d99c69adb580ea9cbf5a1be856f1f0d2f (diff) | |
| download | coinosv3-a8e4358fd2b869a9471e265b11c1bda18764dfbe.tar.gz coinosv3-a8e4358fd2b869a9471e265b11c1bda18764dfbe.zip | |
The explorer link stops blinking with the retry loop — it shows only for transactions genuinely broadcast — and the ETA drops its tilde: "about 25 hours" says approximate once, in words
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 | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/features/ark.js b/src/features/ark.js index 953de5a..14ac9c1 100644 --- a/src/features/ark.js +++ b/src/features/ark.js @@ -869,9 +869,13 @@ export function arkFeature(ctx) { } const exitStartedTs = (a) => Number((a.id || '').split('-')[1]) || Date.now(); + // Only link a tx that is KNOWN to be out there: the claim, a confirmed + // hop, or the finished chain. Guessing from lastError made the link + // flicker in time with the retry loop. const exitWatchTxid = (a) => a.claimTxid - || ((a.hopsDone > 0 || (a.step !== 'chain') || !a.lastError) - ? (a.txids || [])[Math.min(a.hopsDone || 0, (a.txids || []).length - 1)] : null); + || (a.step !== 'chain' ? (a.txids || [])[(a.txids || []).length - 1] + : a.hopsDone > 0 ? (a.txids || [])[Math.min(a.hopsDone, (a.txids || []).length - 1)] + : null); function arkExitActionItem(a) { return h('div', { class: 'item', style: 'cursor:pointer', onClick: () => { ui.arkExitDetail = a.id; render(); } }, @@ -890,9 +894,9 @@ export function arkFeature(ctx) { : a.step === 'timelock' ? Math.max(0, a.claimableAt - (a.tipSeen || 0)) + 1 : 1; const mins = blocks * 10; const eta = getNetwork() === 'regtest' ? t('arkExitSoon') - : mins >= 2880 ? `≈ ${Math.round(mins / 1440)} d` - : mins >= 120 ? `≈ ${Math.round(mins / 60)} h` - : `≈ ${mins} min`; + : mins >= 2880 ? `${Math.round(mins / 1440)} days` + : mins >= 120 ? `${Math.round(mins / 60)} hours` + : `${mins} minutes`; const watch = exitWatchTxid(a); const url = watch ? wallet.api.explorerTx(watch) : null; const cancellable = a.actionable && !(a.hopsDone > 0) && a.step === 'chain'; @@ -2177,15 +2181,15 @@ export function arkFeature(ctx) { : 1; const mins = Math.max(...acts.map(blocksFor)) * 10; const eta = getNetwork() === 'regtest' ? t('arkExitSoon') - : mins >= 2880 ? `≈ ${Math.round(mins / 1440)} d` - : mins >= 120 ? `≈ ${Math.round(mins / 60)} h` - : `≈ ${mins} min`; + : mins >= 2880 ? `${Math.round(mins / 1440)} days` + : mins >= 120 ? `${Math.round(mins / 60)} hours` + : `${mins} minutes`; // The most advanced tx that's actually out there — the one worth watching. // A chain hop that errored before broadcast has nothing to link yet. let watch = null, watchScore = -1; for (const a of acts) { - const score = a.step === 'claiming' ? 3 : a.step === 'timelock' ? 2 : (a.hopsDone > 0 || !a.lastError) ? 1 : 0; - const txid = a.claimTxid || (a.txids || [])[Math.min(a.hopsDone || 0, (a.txids || []).length - 1)]; + const score = a.step === 'claiming' ? 3 : a.step === 'timelock' ? 2 : a.hopsDone > 0 ? 1 : 0; + const txid = exitWatchTxid(a); if (score > 0 && txid && score > watchScore) { watch = txid; watchScore = score; } } const err = acts.find((a) => a.lastError && a.actionable); |
