diff options
| author | Adam Soltys <[email protected]> | 2026-06-14 12:33:29 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-06-17 07:47:45 -0700 |
| commit | 17a4461d8497f4f0f89871bb80604d449487a4c3 (patch) | |
| tree | 1a66a54249afad5f5ec774b3912f1e0657df7bf1 /scripts | |
| parent | 9595de876df5264846227f6f80a7306df9154278 (diff) | |
| download | coinos-server-17a4461d8497f4f0f89871bb80604d449487a4c3.tar.gz coinos-server-17a4461d8497f4f0f89871bb80604d449487a4c3.zip | |
payments: guard /replay double-credit race with SET NX idempotency
Port of master ca28c19f to the staging stack. The getPayment() pre-check
in the lightning listener/replay isn't atomic, so concurrent re-credits of
the same settlement each ran the credit path. Claim each lightning/bolt12
settlement with an atomic SET NX on credited:<ref> (ref = preimage) and
bail if already claimed. Guard sits before tbCredit and the pointer writes
so a duplicate bails cleanly. Also disable the /replay route that triggered
it.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
