This commit is contained in:
Overtorment 2019-04-04 14:10:05 +01:00
parent 862cda69fa
commit 724bc3d656

View File

@ -166,13 +166,10 @@ router.post('/payinvoice', async function(req, res) {
let UserPayee = new User(redis, bitcoinclient, lightning); let UserPayee = new User(redis, bitcoinclient, lightning);
UserPayee._userid = userid_payee; // hacky, fixme UserPayee._userid = userid_payee; // hacky, fixme
let payee_balance = await UserPayee.getBalance(); await UserPayee.clearBalanceCache();
payee_balance += info.num_satoshis * 1;
await UserPayee.saveBalance(payee_balance);
// sender spent his balance: // sender spent his balance:
userBalance -= info.num_satoshis * 1; await u.clearBalanceCache();
await u.saveBalance(userBalance);
await u.savePaidLndInvoice({ await u.savePaidLndInvoice({
timestamp: parseInt(+new Date() / 1000), timestamp: parseInt(+new Date() / 1000),
type: 'paid_invoice', type: 'paid_invoice',