diff options
| author | Adam Soltys <[email protected]> | 2026-09-26 23:49:09 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-26 23:49:09 -0700 |
| commit | cacfabdd206b243fc3e49ea6942d8ac76f6dd198 (patch) | |
| tree | 4a7e74deb09bd76c378f56b97916e20106e3033d /src/ark | |
| parent | 6c4e3d1fe2bac42f8497488335e808b5b097061a (diff) | |
| download | coinosv3-cacfabdd206b243fc3e49ea6942d8ac76f6dd198.tar.gz coinosv3-cacfabdd206b243fc3e49ea6942d8ac76f6dd198.zip | |
Renewal repair: a coin already held as spent is not asked about (its bytes may be pruned).
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VhUKyXKtsJ67QAFfb7QR9D
Diffstat (limited to 'src/ark')
| -rw-r--r-- | src/ark/manager.js | 10 |
1 files changed, 8 insertions, 2 deletions
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) { |
