diff options
| author | Adam Soltys <[email protected]> | 2024-09-10 10:17:27 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2024-09-10 10:17:27 -0700 |
| commit | bc94288f562223ca3bd0dd969c68c6650adf6089 (patch) | |
| tree | d10682f94837199c39973951dea5d6e365f1d70f /routes/payments.ts | |
| parent | 9c77d45cfb56e79e97b70678e21b8d6a56ec6c78 (diff) | |
| download | coinos-server-bc94288f562223ca3bd0dd969c68c6650adf6089.tar.gz coinos-server-bc94288f562223ca3bd0dd969c68c6650adf6089.zip | |
accounts
Diffstat (limited to 'routes/payments.ts')
| -rw-r--r-- | routes/payments.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/routes/payments.ts b/routes/payments.ts index 34d7c073..dbf5a8fd 100644 --- a/routes/payments.ts +++ b/routes/payments.ts @@ -283,7 +283,8 @@ export default { if (!p) { let account; - if ((await g(`${wallet}:balance`)) !== null) account = wallet; + let bal = await g(`balance:${wallet}`); + if (bal !== null) account = wallet; await credit({ hash: address, amount: sats(amount), @@ -311,8 +312,8 @@ export default { .multi() .set(`invoice:${iid}`, JSON.stringify(invoice)) .set(`payment:${p.id}`, JSON.stringify(p)) - .decrBy(`pending:${p.uid}`, p.amount) - .incrBy(`balance:${p.uid}`, p.amount) + .decrBy(`pending:${p.account || p.uid}`, p.amount) + .incrBy(`balance:${p.account || p.uid}`, p.amount) .exec(); emit(p.uid, "payment", p); |
