Adjust the lastPageFirstIndexOffset value and check to be consistent across the 'getPayments' and 'getFailedPayments' methods since internally they both paginate in the exact same way. In both cases if there are payments present in the lnd then the last offset is 1, but if there are no payments then the last offset is 0.
Also noteworthy, when you go back with a token of {"offset":1,"limit":250} you would get 0 payments back for both methods, which confirms that a last offset of 1 works fine.
I also removed a redundant ternary check to make the returns for both methods consistent.
Description
Adjust the
lastPageFirstIndexOffset
value and check to be consistent across the 'getPayments' and 'getFailedPayments' methods since internally they both paginate in the exact same way. In both cases if there are payments present in the lnd then the last offset is1
, but if there are no payments then the last offset is0
.Also noteworthy, when you go back with a token of
{"offset":1,"limit":250}
you would get 0 payments back for both methods, which confirms that a last offset of1
works fine.I also removed a redundant ternary check to make the returns for both methods consistent.