rpcserver: filter out non-suceeded payments, include payment status

Earlier versions of ListPayments only included completed payments. We
return to this behavior by ignore all other payments if the nonSucceeded
boolean is not set in the request.
This commit is contained in:
Johan T. Halseth committed 2019-06-12 08:57:47 +02:00
1 parent 6794708ed5
commit 0aec3fd230
2 files changed
+47 -9

No files matched your search

+6 -2
View File
@@ -13281,7 +13281,9 @@ func testHoldInvoicePersistence(net *lntest.NetworkHarness, t *harnessTest) {
// The payments should now show up in Alice's ListInvoices, with a zero
// preimage, indicating they are not yet settled.
err = lntest.WaitNoError(func() error {
req := &lnrpc.ListPaymentsRequest{}
req := &lnrpc.ListPaymentsRequest{
NonSucceeded: true,
}
ctxt, _ = context.WithTimeout(ctxt, defaultTimeout)
paymentsResp, err := net.Alice.ListPayments(ctxt, req)
if err != nil {
@@ -13458,7 +13460,9 @@ func testHoldInvoicePersistence(net *lntest.NetworkHarness, t *harnessTest) {
// Check that Alice's invoices to be shown as settled and failed
// accordingly, and preimages matching up.
req := &lnrpc.ListPaymentsRequest{}
req := &lnrpc.ListPaymentsRequest{
NonSucceeded: true,
}
ctxt, _ = context.WithTimeout(ctxt, defaultTimeout)
paymentsResp, err := net.Alice.ListPayments(ctxt, req)
if err != nil {