alexbosworth / lightning

Lightning client methods
MIT License
127 stars 33 forks source link

Add getPendingPayments or allow to pass include_incomplete #61

Closed dolcalmi closed 2 years ago

dolcalmi commented 2 years ago

Trying to create a fallback for this https://github.com/lightningnetwork/lnd/issues/6249 we found that there is no way to get pending payments (and now we know that we can't trust in trackpayment response).

Do you prefer getPendingPayments or include include_incomplete in getPayments?

Let us know what you prefer to push a PR

thanks in advance

ps: also would be useful get the raw status https://github.com/alexbosworth/lightning/blob/master/lnd_responses/rpc_payment_as_payment.js#L206 because we delete failed attemps so is not possible to compare against track payment

alexbosworth commented 2 years ago

getPendingPayments would be cool sure

alexbosworth commented 2 years ago

Will the response of this API be different from trackpayment?

vindard commented 2 years ago

I think the idea is to use the listPayments api instead (for attempts)

dolcalmi commented 2 years ago

Will the response of this API be different from trackpayment?

it will be similar to getFailedPayments, should use https://github.com/alexbosworth/lightning/blob/master/lnd_responses/rpc_payment_as_payment.js

alexbosworth commented 2 years ago

OK that makes sense, yeah this could be an interesting addition to see what payments are in flight

I'm curious if there is a difference between the result of listpayment for pending and getchannels => map htlc hashes to track payment results