aboutsummaryrefslogtreecommitdiffstats
path: root/lib/migrate.js.map
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-05-25 09:22:26 -0700
committerAdam Soltys <[email protected]>2026-05-25 09:22:26 -0700
commit8aba0bc2e3b5d09b3783b87eb0a29088b40796e4 (patch)
treeb330ee6762c36b7d163b99556e56aec8ccdf0551 /lib/migrate.js.map
parentcb0f1962238534ce0fa2261373a018bf34a868f5 (diff)
downloadcoinos-server-8aba0bc2e3b5d09b3783b87eb0a29088b40796e4.tar.gz
coinos-server-8aba0bc2e3b5d09b3783b87eb0a29088b40796e4.zip
finalize: don't crash on non-integer fee delta (db.incrBy NaN)
Triggered by a recurring "finalize threw despite no failed_parts: ERR value is not an integer or out of range" warning. Root cause: when xpay's response shape is unexpected (or invoice is zero-amount and decoded amount_msat is undefined), the computed p.fee becomes NaN. The subsequent db.incrBy(balance:<uid>, maxfee - NaN) throws because Redis can't increment by NaN. Symptom: leak guard fires "ref set in db despite throw" — payment is actually fine (p.ref persisted before the throw) but finalize never completes the fee refund. User loses up to maxfee sats (was already debited maxfee, gets nothing back). Fix: validate the computed fee is a finite integer; if not, keep the originally-reserved maxfee (zero refund, no balance corruption) and warn loudly. Same guard on the refund delta before db.incrBy. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Diffstat (limited to 'lib/migrate.js.map')
0 files changed, 0 insertions, 0 deletions