Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ListPayments: filter out non-succeeded payments, include payment status #3190

Merged
merged 2 commits into from
Jun 13, 2019

Conversation

halseth
Copy link
Contributor

@halseth halseth commented Jun 11, 2019

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

Copy link
Contributor

@wpaulino wpaulino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💫

Note: the status will show in the lncli response as UNKNOWN, SUCCEEDED, IN_FLIGHT, and FAILED for those wondering.

@wpaulino wpaulino added this to the 0.7 milestone Jun 12, 2019
@Roasbeef
Copy link
Member

Fails existing integration tests:

    --- FAIL: TestLightningNetworkDaemon/hold_invoice_sender_persistence (22.03s)
        lnd_test.go:88: Failed: (hold invoice sender persistence): exited with error: 
            *errors.errorString predicate not satisfied: payhash not found in response
            /home/travis/gopath/src/github.com/lightningnetwork/lnd/lntest/itest/lnd_test.go:13328 (0xd3ab63)
            	testHoldInvoicePersistence: t.Fatalf("predicate not satisfied: %v", err)
            /home/travis/gopath/src/github.com/lightningnetwork/lnd/lntest/itest/lnd_test.go:113 (0xced806)
            	(*harnessTest).RunTestCase: testCase.test(net, h)
            /home/travis/gopath/src/github.com/lightningnetwork/lnd/lntest/itest/lnd_test.go:13866 (0xd541f5)
            	TestLightningNetworkDaemon.func4: ht.RunTestCase(testCase, lndHarness)
            /home/travis/.gimme/versions/go1.12.6.linux.amd64/src/testing/testing.go:865 (0x4fbeb0)
            	tRunner: fn(t)
            /home/travis/.gimme/versions/go1.12.6.linux.amd64/src/runtime/asm_amd64.s:1337 (0x45e6d1)
            	goexit: BYTE	$0x90	// NOP

Also make it optional to list non-succeeded payments.
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.
}

message ListPaymentsRequest {
/// Set to also return payments that are not (yet) succeeded.
bool non_succeeded = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naming suggestion: include_incomplete or include_unsuccessful?

}

return paymentsResp, nil
}

// convertPaymentStatus converts a channeldb.PaymentStatus to the type expected
// by the RPC.
func convertPaymentStatus(dbStatus channeldb.PaymentStatus) (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this something that could be defined in lnrpc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants