aboutsummaryrefslogtreecommitdiffstats
path: root/routes/bitcoin/receive.js
diff options
context:
space:
mode:
Diffstat (limited to 'routes/bitcoin/receive.js')
-rw-r--r--routes/bitcoin/receive.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/routes/bitcoin/receive.js b/routes/bitcoin/receive.js
index e0e3828b..2a6a7954 100644
--- a/routes/bitcoin/receive.js
+++ b/routes/bitcoin/receive.js
@@ -159,10 +159,13 @@ setInterval(async () => {
let total = p.amount + p.tip;
p.confirmed = 1;
- p.account.balance += total;
- p.account.pending -= Math.min(p.account.pending, total);
-
await p.account.save({ transaction });
+ await p.account.increment({ balance: total }, { transaction });
+ await p.account.decrement(
+ { pending: Math.min(p.account.pending, total) },
+ { transaction }
+ );
+ await p.account.reload({ transaction });
await p.save({ transaction });
p = p.get({ plain: true });