Browse Source

fix paginate payments

feature/dockerfile-arm
Evan Feenstra 5 years ago
parent
commit
f463c0b5f7
  1. 4
      api/utils/lightning.ts
  2. 4
      dist/api/utils/lightning.js

4
api/utils/lightning.ts

@ -263,9 +263,9 @@ async function paginatePayments(limit,i=0){
const r:any = await listPaymentsPaginated(limit,i) const r:any = await listPaymentsPaginated(limit,i)
const lastOffset = parseInt(r.first_index_offset) // this is "first" cuz its in reverse (lowest index) const lastOffset = parseInt(r.first_index_offset) // this is "first" cuz its in reverse (lowest index)
if(lastOffset>0) { if(lastOffset>0) {
return r.invoices.concat(await paginatePayments(limit,lastOffset)) return r.payments.concat(await paginatePayments(limit,lastOffset))
} }
return r.invoices return r.payments
}catch(e){ }catch(e){
return [] return []
} }

4
dist/api/utils/lightning.js

@ -297,9 +297,9 @@ function paginatePayments(limit, i = 0) {
const r = yield listPaymentsPaginated(limit, i); const r = yield listPaymentsPaginated(limit, i);
const lastOffset = parseInt(r.first_index_offset); // this is "first" cuz its in reverse (lowest index) const lastOffset = parseInt(r.first_index_offset); // this is "first" cuz its in reverse (lowest index)
if (lastOffset > 0) { if (lastOffset > 0) {
return r.invoices.concat(yield paginatePayments(limit, lastOffset)); return r.payments.concat(yield paginatePayments(limit, lastOffset));
} }
return r.invoices; return r.payments;
} }
catch (e) { catch (e) {
return []; return [];

Loading…
Cancel
Save