diff options
| author | Adam Soltys <[email protected]> | 2021-01-15 15:31:46 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2021-01-15 15:31:46 -0800 |
| commit | d01159ce9eee956dca32fd69525c0edd5aae9477 (patch) | |
| tree | e6a4d4a928daffb5bcedbc3411a0dfded6ff422f /routes/lightning | |
| parent | d03dad4d85ccd107068719c4b68cbd6a255864f6 (diff) | |
| download | coinos-server-d01159ce9eee956dca32fd69525c0edd5aae9477.tar.gz coinos-server-d01159ce9eee956dca32fd69525c0edd5aae9477.zip | |
add more transactions and locks
Diffstat (limited to 'routes/lightning')
| -rw-r--r-- | routes/lightning/receive.js | 4 |
1 files changed, 2 insertions, 2 deletions
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); |
