FIX: more strict balance check (re #8)
This commit is contained in:
parent
f2386f0acf
commit
e854626a45
@ -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);
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user