diff options
| author | Adam Soltys <[email protected]> | 2026-09-21 10:32:36 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-21 10:32:36 -0700 |
| commit | 683184f65eb71bdfd12550e7293f0c721100dd9b (patch) | |
| tree | c3925bdab4dea556f2d4eae0faac9321ab5b2a42 /src/ark/manager.js | |
| parent | 236c8a025347ca86c4a3041ed67062c29ded8bbe (diff) | |
| download | coinosv3-683184f65eb71bdfd12550e7293f0c721100dd9b.tar.gz coinosv3-683184f65eb71bdfd12550e7293f0c721100dd9b.zip | |
Ark: an issued-but-unpaid invoice on a preimage index is skipped too.
The ASP answers a settled hash with "already been paid" and a merely
issued one with "UNIQUE constraint failed: invoices.payment_hash"; both
mean the index is taken. Headroom raised to 200 skips.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Tmfg8k5f3TbNJS34qiqHAp
Diffstat (limited to 'src/ark/manager.js')
| -rw-r--r-- | src/ark/manager.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ark/manager.js b/src/ark/manager.js index 3477638..18c69b7 100644 --- a/src/ark/manager.js +++ b/src/ark/manager.js @@ -1355,8 +1355,11 @@ export class ArkManager { }); break; } catch (e) { - const used = /already been paid|already exists|already in use|duplicate/i.test(e?.message || ''); - if (!used || tries >= 50) throw e; + // "already been paid" for a settled one; "UNIQUE constraint failed: + // invoices.payment_hash" for one merely issued before — both mean + // this index is spoken for + const used = /already been paid|already exists|already in use|duplicate|UNIQUE constraint|payment_hash/i.test(e?.message || ''); + if (!used || tries >= 200) throw e; this._save(); // remember the skipped index even if the next try fails } } |
