aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-07-31 23:22:50 -0700
committerAdam Soltys <[email protected]>2026-07-31 23:22:50 -0700
commitfb09303ff274a241c28cccc0cd29550f6e59d0b2 (patch)
tree523cd275593ed8ddc2cd8d66faa6bc00a2425803 /lib
parent733929010b0ec96a580c65b69345a854e0112611 (diff)
downloadcoinos-server-fb09303ff274a241c28cccc0cd29550f6e59d0b2.tar.gz
coinos-server-fb09303ff274a241c28cccc0cd29550f6e59d0b2.zip
confirm: guard the first-seen deposit credit atomically (COINOS-2)
/confirm is unauthenticated, and its first-seen branch credited a deposit after a plain getPayment() read with no lock. Concurrent callers (walletnotify, catchUp, bulk sweeps, or anyone posting the endpoint) all read p == null for one deposit and each ran credit(), inflating both the pending balance and the spendable credit:<net>:<uid> fee accumulator — a fee waiver nobody paid for. Verified on regtest: 10 concurrent /confirm on one 100,000 sat deposit credited 1,000,000 pending and 4,000 fee credit. With the NX guard, exactly 100,000 and 400. Mirrors the lock the confirm stage already had. Reported-by: Muhammed Shekho (@SYR-ROOT) <[email protected]> Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions