FIX: more strict balance check (re #8)

This commit is contained in:
Overtorment 2019-01-21 19:49:19 +00:00
parent f2386f0acf
commit e854626a45
2 changed files with 2 additions and 2 deletions

View File

@ -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);

View File

@ -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) {