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

@@ -230,10 +230,18 @@ export class User {
for (let invoice of range) {
invoice = JSON.parse(invoice);
invoice.type = 'paid_invoice';
invoice.fee = +invoice.payment_route.total_fees;
invoice.value = +invoice.payment_route.total_fees + +invoice.payment_route.total_amt;
invoice.timestamp = invoice.decoded.timestamp;
invoice.memo = invoice.decoded.description;
// for internal invoices it might not have properties `payment_route` and `decoded`...
if (invoice.payment_route) {
invoice.fee = +invoice.payment_route.total_fees;
invoice.value = +invoice.payment_route.total_fees + +invoice.payment_route.total_amt;
} else {
invoice.fee = 0;
}
if (invoice.decoded) {
invoice.timestamp = invoice.decoded.timestamp;
invoice.memo = invoice.decoded.description;
}
result.push(invoice);
}