FIX: internal invoice wasnt saving record in senders tx list

This commit is contained in:
Overtorment
2018-12-27 00:44:13 +00:00
parent b8bc4dd0cd
commit 5100252ea5
2 changed files with 20 additions and 5 deletions

View File

@@ -130,8 +130,15 @@ router.post('/payinvoice', async function(req, res) {
// sender spent his balance:
userBalance -= info.num_satoshis * 1;
await u.saveBalance(userBalance);
await u.savePaidLndInvoice({
timestamp: parseInt(+new Date() / 1000),
type: 'paid_invoice',
value: info.num_satoshis * 1,
fee: 0, // internal invoices are free
memo: decodeURIComponent(info.description),
});
await u.setPaymentHashPaid(info.payment_hash);
await UserPayee.setPaymentHashPaid(info.payment_hash);
return res.send(info);
}