diff options
| author | Adam Soltys <[email protected]> | 2026-06-13 14:21:44 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-06-13 14:21:44 -0700 |
| commit | ca28c19fe26d3f81ae62d2d3f0dc8b175849a9a8 (patch) | |
| tree | 2be3077a7e59ce1645b9209b52d507735a8c55d5 /index.ts | |
| parent | 43427afe5b0b16d887163bd788360ac29105d69c (diff) | |
| download | coinos-server-ca28c19fe26d3f81ae62d2d3f0dc8b175849a9a8.tar.gz coinos-server-ca28c19fe26d3f81ae62d2d3f0dc8b175849a9a8.zip | |
payments: guard /replay double-credit race with SET NX idempotency
getPayment() pre-check in the lightning listener/replay isn't atomic, so
concurrent re-credits of the same settlement each ran incrBy. Claim each
lightning/bolt12 settlement with an atomic SET NX on credited:<ref>
(ref = preimage) and bail if already claimed. Also disable the /replay
route that triggered it.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Diffstat (limited to 'index.ts')
| -rw-r--r-- | index.ts | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -187,7 +187,7 @@ app.post("/melt", auth, ecash.melt); app.post("/ecash/:id", ecash.receive); app.get("/replay/:index", (req, res) => { - replay(req.params.index); + // replay(req.params.index); res.send({}); }); |
