From c8ad07959fe5437064dbcc61bc12b4e52103fff7 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 8 Oct 2022 04:12:23 +0000 Subject: check for invoice --- lib/sync.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') 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 }); }); -- cgit v1.2.3