diff options
| author | Adam Soltys <[email protected]> | 2026-07-10 22:55:56 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-07-10 22:55:56 -0700 |
| commit | 9f06a2d677e579609ab70e4f8dc0742d112cda47 (patch) | |
| tree | c7c6f8d015e9fa2db2d54c883cdcdff9e7edc213 /scripts/analytics.ts | |
| parent | c5bcf51d6adb1c7718f08ff11a9652762c51669d (diff) | |
| download | coinos-server-9f06a2d677e579609ab70e4f8dc0742d112cda47.tar.gz coinos-server-9f06a2d677e579609ab70e4f8dc0742d112cda47.zip | |
payments: use the debited tip when crediting internal transfers
credit() now credits the tip the sender was actually debited (passed in
by the internal-transfer callers) instead of independently re-reading the
invoice. This closes a time-of-check/time-of-use gap where an invoice's
tip could be changed between the sender debit and the receiver credit,
letting a payer be credited a tip they were never charged.
External receipts (lightning/ecash) keep reading the invoice tip, since
there is no paired coinos debit to diverge from.
Also harden POST /invoice/:id: validate the tip is a sane non-negative
integer and reject tip changes on an already-settled invoice.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Diffstat (limited to 'scripts/analytics.ts')
0 files changed, 0 insertions, 0 deletions
