aboutsummaryrefslogtreecommitdiffstats
path: root/lib/sockets.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-08 22:36:52 -0700
committerAdam Soltys <[email protected]>2026-08-08 22:36:52 -0700
commit14948460559788db024ff99406dd18adaed206ba (patch)
tree44604c20bd8145dc5c423e6c3a51420367c5d737 /lib/sockets.ts
parentdea17487cf4fe63d029b760749e8675183042d3c (diff)
downloadcoinos-server-14948460559788db024ff99406dd18adaed206ba.tar.gz
coinos-server-14948460559788db024ff99406dd18adaed206ba.zip
payments: prevent same-invoice retry from orphaning an unreconciled debit
The pending reconciliation set is keyed by bolt11, shared across attempts at the same invoice. A retry made after a prior attempt's CLN parts resolved (but before check() reconciled its debit) would pass the listpays-only guard, and the retry's own reverse()/finalize() then removed the shared entry — permanently hiding the first attempt's debit from check(), so a failed send was never auto-refunded. - sendLightning: refuse to pay while the invoice's bolt11 is still in the pending set; the caller is told to retry shortly. - check(): an entry whose payment record no longer exists in db or archive is dropped from the set instead of skipped, so a dead entry can't block its invoice forever under the new guard. Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'lib/sockets.ts')
0 files changed, 0 insertions, 0 deletions