From cacfabdd206b243fc3e49ea6942d8ac76f6dd198 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 26 Sep 2026 23:49:09 -0700 Subject: Renewal repair: a coin already held as spent is not asked about (its bytes may be pruned). Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01VhUKyXKtsJ67QAFfb7QR9D --- src/ark/manager.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/ark/manager.js') diff --git a/src/ark/manager.js b/src/ark/manager.js index 4a0a9c6..c103806 100644 --- a/src/ark/manager.js +++ b/src/ark/manager.js @@ -1927,8 +1927,14 @@ export class ArkManager { // round ran, and the inputs are still ours to submit again. Left alone, // the action sat "in progress" for weeks, asking on every sync. async _repairSubmitted(action, inputRecs) { - const states = await Promise.all(inputRecs.map((v) => - getVtxoStatus(this.arkUrl, this._decoded(v).point.raw, this._keyForVtxo(v).privkey).catch(() => null))); + // a coin this wallet already holds as spent needs no asking — and an old + // spent coin has had its bytes pruned, so it could not be asked about + const states = await Promise.all(inputRecs.map((v) => { + if (!v) return null; + if (v.state === 'spent') return VTXO_STATE_SPENT; + try { return getVtxoStatus(this.arkUrl, this._decoded(v).point.raw, this._keyForVtxo(v).privkey).catch(() => null); } + catch { return null; } + })); if (states.some((st) => st == null)) return; // couldn't tell today; ask again next sync const spent = inputRecs.filter((v, i) => states[i] === VTXO_STATE_SPENT); if (spent.length === inputRecs.length) { -- cgit v1.2.3