diff options
| author | Adam Soltys <[email protected]> | 2022-10-08 00:34:34 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-10-08 00:34:34 -0700 |
| commit | 0fbba88257d0259f59ef86e34d83987d74824030 (patch) | |
| tree | 76c5b023755ede0f9075f5134dd5ff6aff538b06 /lib | |
| parent | 6eb65756c0945c149825f2fbe0f6cf173ffee2ef (diff) | |
| parent | 11052f0f494707206a9f6a245d6c24a9090ebf78 (diff) | |
| download | coinos-server-0fbba88257d0259f59ef86e34d83987d74824030.tar.gz coinos-server-0fbba88257d0259f59ef86e34d83987d74824030.zip | |
Merge remote-tracking branch 'origin/prod'
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sync.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sync.js b/lib/sync.js index eeff7362..df7c812f 100644 --- a/lib/sync.js +++ b/lib/sync.js @@ -243,7 +243,9 @@ const sync = async () => { l("confirming payment", p.id, p.user_id, p.hash, p.address); await p.save({ transaction }); - await p.invoice.increment({ received: p.amount }, { transaction }); + if (p.invoice) + await p.invoice.increment({ received: p.amount }, { transaction }); + await p.account.increment({ balance: p.amount }, { transaction }); await p.account.decrement({ pending: p.amount }, { transaction }); }); @@ -251,7 +253,7 @@ const sync = async () => { emit(p.user.username, "account", p.account); emit(p.user.username, "payment", p); } catch (e) { - err("problem confirming payment", p, e.message, e.stack); + err("problem confirming payment", p.id, e.message, e.stack); } } |
