diff --git a/class/User.js b/class/User.js index dfd364d..732f25c 100644 --- a/class/User.js +++ b/class/User.js @@ -352,7 +352,7 @@ export class User { return; } - let userBalance = await this.getBalance(); + let userBalance = await this.getCalculatedBalance(); userBalance += new BigNumber(tx.amount).multipliedBy(100000000).toNumber(); await this.saveBalance(userBalance); await this._redis.rpush('imported_txids_for_' + this._userid, tx.txid); diff --git a/controllers/api.js b/controllers/api.js index f17b186..f47fe1c 100644 --- a/controllers/api.js +++ b/controllers/api.js @@ -120,7 +120,7 @@ router.post('/payinvoice', async function(req, res) { return errorTryAgainLater(res); } - let userBalance = await u.getBalance(); + let userBalance = await u.getCalculatedBalance(); lightning.decodePayReq({ pay_req: req.body.invoice }, async function(err, info) { if (err) {