fix: do not return failed LND payments in list_transactions

This commit is contained in:
Roland Bewick 2023-12-15 16:34:04 +07:00
parent 1adb12faa6
commit 8b30f59d11
2 changed files with 7 additions and 0 deletions

View file

@ -143,6 +143,7 @@ You can also contribute to our [bounty program](https://github.com/getAlby/light
`list_transactions`
- ⚠️ from and until in request not supported
- ⚠️ failed payments will not be returned
`multi_pay_invoice`
@ -174,6 +175,7 @@ You can also contribute to our [bounty program](https://github.com/getAlby/light
`list_transactions`
- ⚠️ offset and unpaid in request not supported
- ⚠️ fees_paid in response not supported
- ⚠️ unsettled and failed transactions will not be returned
`multi_pay_invoice`

5
lnd.go
View file

@ -102,6 +102,11 @@ func (svc *LNDService) ListTransactions(ctx context.Context, senderPubkey string
payments = outgoingResp.Payments
}
for _, payment := range payments {
if payment.Status == lnrpc.Payment_FAILED {
// don't return failed payments for now
// this will cause retrieved amount to be less than limit
continue
}
var paymentRequest decodepay.Bolt11
var expiresAt time.Time
var description string