mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-23 12:38:07 +01:00
routing+routerrpc: notify full payment structures
This commit fixes the inconsistency between the payment state as reported by routerrpc.SendPayment/routerrpc.TrackPayment and the main rpc ListPayments call. In addition to that, payment state changes are now sent out for every state change. This opens the door to user interfaces giving more feedback to the user about the payment process. This is especially interesting for multi-part payments.
This commit is contained in:
@@ -393,14 +393,14 @@ func sendPaymentRequest(ctx *cli.Context,
|
||||
return err
|
||||
}
|
||||
|
||||
if status.State != routerrpc.PaymentState_IN_FLIGHT {
|
||||
if status.Status != lnrpc.Payment_IN_FLIGHT {
|
||||
printRespJSON(status)
|
||||
|
||||
// If we get a payment error back, we pass an error up
|
||||
// to main which eventually calls fatal() and returns
|
||||
// with a non-zero exit code.
|
||||
if status.State != routerrpc.PaymentState_SUCCEEDED {
|
||||
return errors.New(status.State.String())
|
||||
if status.Status != lnrpc.Payment_SUCCEEDED {
|
||||
return errors.New(status.Status.String())
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -454,7 +454,7 @@ func trackPayment(ctx *cli.Context) error {
|
||||
|
||||
printRespJSON(status)
|
||||
|
||||
if status.State != routerrpc.PaymentState_IN_FLIGHT {
|
||||
if status.Status != lnrpc.Payment_IN_FLIGHT {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user