aboutsummaryrefslogtreecommitdiffstats
path: root/lib/auth.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-06-13 14:21:44 -0700
committerAdam Soltys <[email protected]>2026-06-13 14:21:44 -0700
commitca28c19fe26d3f81ae62d2d3f0dc8b175849a9a8 (patch)
tree2be3077a7e59ce1645b9209b52d507735a8c55d5 /lib/auth.ts
parent43427afe5b0b16d887163bd788360ac29105d69c (diff)
downloadcoinos-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 'lib/auth.ts')
0 files changed, 0 insertions, 0 deletions