aboutsummaryrefslogtreecommitdiffstats
path: root/src/ark
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-09 19:55:37 -0700
committerAdam Soltys <[email protected]>2026-08-09 19:55:37 -0700
commit03fda2bc96a9bcaf2f864e5e80ad338948689c98 (patch)
treef6abe40154e36db6fa73cb0f022ec748f664365f /src/ark
parent75270f0329c95422d28d7c15d2b532673eb8343d (diff)
downloadcoinosv3-03fda2bc96a9bcaf2f864e5e80ad338948689c98.tar.gz
coinosv3-03fda2bc96a9bcaf2f864e5e80ad338948689c98.zip
A waiting board says what it waits for: the Moving line counts confirmations, a snag shows itself, and one stuck action no longer starves the queue behind it
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01DbA53PJA8fgSvMcEzfuw22
Diffstat (limited to 'src/ark')
-rw-r--r--src/ark/manager.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/ark/manager.js b/src/ark/manager.js
index 84c0769..a57b280 100644
--- a/src/ark/manager.js
+++ b/src/ark/manager.js
@@ -350,9 +350,11 @@ export class ArkManager {
if (action.type === 'ln-recv') await this._driveLnRecv(action);
if (action.lastError) { delete action.lastError; this._save(); }
} catch (e) {
- // transient errors leave the action where it is; a later sync retries
- if (!(e instanceof GrpcError)) throw e;
- if (action.type.startsWith('ln-')) { action.lastError = e.message; this._save(); }
+ // transient errors leave the action where it is; a later sync retries.
+ // Recorded and swallowed for EVERY type: one broken action rethrowing
+ // here would starve everything queued behind it, forever and silently.
+ action.lastError = e.message;
+ this._save();
}
}
}
@@ -1209,10 +1211,14 @@ export class ArkManager {
if (action.step === 'created') return; // waiting for funding txid
const keys = this._key(action.keyIndex);
if (action.step === 'funded') {
+ const need = this.info.requiredBoardConfirmations;
const status = await this.chain.getTxStatus(action.fundingTxid);
- if (!status?.confirmed) return; // wait for confirmations; retried on sync
- const tip = await this.chain.tipHeight();
- if (tip - status.block_height + 1 < this.info.requiredBoardConfirmations) return;
+ // record progress so the UI can say WHERE the wait is (n/need confs)
+ const confs = status?.confirmed ? (await this.chain.tipHeight()) - status.block_height + 1 : 0;
+ if (confs !== action.confs || need !== action.needConfs) { action.confs = confs; action.needConfs = need; this._save(); }
+ // NB not `confs < need`: a failed tip fetch makes confs NaN, which must
+ // wait for the next sync rather than slip past the comparison
+ if (!(confs >= need)) return; // retried on sync
const fundingOutpointRaw = new Uint8Array(36);
fundingOutpointRaw.set(hex.decode(action.fundingTxid).reverse(), 0); // vout 0