From 4e7d0de7cc15f6b49afeb9ddb1a7d4e4f2cb6cba Mon Sep 17 00:00:00 2001 From: kiwiidb Date: Mon, 9 Oct 2023 14:07:19 +0200 Subject: [PATCH] legacy endpoint: no errored invoices --- controllers/gettxs.ctrl.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/controllers/gettxs.ctrl.go b/controllers/gettxs.ctrl.go index 134a3365..38913b48 100644 --- a/controllers/gettxs.ctrl.go +++ b/controllers/gettxs.ctrl.go @@ -65,6 +65,10 @@ func (controller *GetTXSController) GetTXS(c echo.Context) error { response := make([]OutgoingInvoice, len(invoices)) for i, invoice := range invoices { + //only return settled invoices + if invoice.State != common.InvoiceStateSettled { + continue + } rhash, _ := lib.ToJavaScriptBuffer(invoice.RHash) response[i] = OutgoingInvoice{ RHash: rhash,