diff options
| author | Adam Soltys <[email protected]> | 2022-10-08 04:12:23 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-10-08 04:12:23 +0000 |
| commit | c8ad07959fe5437064dbcc61bc12b4e52103fff7 (patch) | |
| tree | ede23278dbbef6bcafba2321cc1960bd3e7671bf /lib/sync.js | |
| parent | 51413aa3d23260d8c244ed2015a1ca58b24ab5cb (diff) | |
| download | coinos-server-c8ad07959fe5437064dbcc61bc12b4e52103fff7.tar.gz coinos-server-c8ad07959fe5437064dbcc61bc12b4e52103fff7.zip | |
check for invoice
Diffstat (limited to 'lib/sync.js')
| -rw-r--r-- | lib/sync.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sync.js b/lib/sync.js index b2020acd..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 }); }); |
