From 6cffbb23fbbc69fc55f44a4a94161aa539d49629 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Tue, 18 Aug 2026 00:42:47 -0700 Subject: A confirmed board stops waiting on a flaky tip: confirmation itself counts for one, and a failed mailbox read no longer starves the drives that only need the chain Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz --- src/ark/manager.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/ark') diff --git a/src/ark/manager.js b/src/ark/manager.js index 7be74fe..01e257a 100644 --- a/src/ark/manager.js +++ b/src/ark/manager.js @@ -1346,11 +1346,16 @@ export class ArkManager { if (action.step === 'funded') { const need = this.info.requiredBoardConfirmations; const status = await this.chain.getTxStatus(action.fundingTxid); - // 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; + // record progress so the UI can say WHERE the wait is (n/need confs). + // A confirmed status proves at least ONE confirmation on its own — the + // tip fetch only refines the count, so its failure (rate limits) must + // not strand a confirmed board at "0/need" forever. + let confs = 0; + if (status?.confirmed) { + const tip = await this.chain.tipHeight().catch(() => null); + confs = tip != null && Number.isFinite(tip) ? tip - status.block_height + 1 : 1; + } 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); -- cgit v1.2.3