From d01159ce9eee956dca32fd69525c0edd5aae9477 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 15 Jan 2021 15:31:46 -0800 Subject: add more transactions and locks --- routes/lightning/receive.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'routes/lightning') diff --git a/routes/lightning/receive.js b/routes/lightning/receive.js index 5b0d1d77..0c8d6557 100644 --- a/routes/lightning/receive.js +++ b/routes/lightning/receive.js @@ -55,9 +55,9 @@ const handlePayment = async (msg) => { let total = amount + tip; invoice.received += total; - account.balance += total; - await account.save({ transaction }); + await account.increment({ balance: total }, { transaction }); + await account.reload({ transaction }); await invoice.save({ transaction }); await payment.save({ transaction }); payments.push(msg.payment_request); -- cgit v1.2.3