rpcserver: return full path payments go over in SendPayment
This commit augments the server’s response to successful SendPayment commands by also returning the full path taken in order to fulfill the payment. With this information, the user now obtains more context about their payment whcih can be useful when debugging, or just exploring the capabilities of the daemon.
This commit is contained in:
parent
765d9fd5e9
commit
7d6d8187fb
12
rpcserver.go
12
rpcserver.go
@ -915,7 +915,9 @@ func (r *rpcServer) SendPayment(paymentStream lnrpc.Lightning_SendPaymentServer)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO(roasbeef): proper responses
|
// TODO(roasbeef): proper responses
|
||||||
resp := &lnrpc.SendResponse{}
|
resp := &lnrpc.SendResponse{
|
||||||
|
PaymentRoute: marshalRoute(route),
|
||||||
|
}
|
||||||
if err := paymentStream.Send(resp); err != nil {
|
if err := paymentStream.Send(resp); err != nil {
|
||||||
errChan <- err
|
errChan <- err
|
||||||
return
|
return
|
||||||
@ -1560,9 +1562,13 @@ func (r *rpcServer) QueryRoute(_ context.Context, in *lnrpc.RouteRequest) (*lnrp
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a route exsits within the network that is able to support our
|
// If a route exists within the network that is able to support our
|
||||||
// request, then we'll convert the result into the format required by
|
// request, then we'll convert the result into the format required by
|
||||||
// the RPC system.
|
// the RPC system.
|
||||||
|
return marshalRoute(route), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func marshalRoute(route *routing.Route) *lnrpc.Route {
|
||||||
resp := &lnrpc.Route{
|
resp := &lnrpc.Route{
|
||||||
TotalTimeLock: route.TotalTimeLock,
|
TotalTimeLock: route.TotalTimeLock,
|
||||||
TotalFees: int64(route.TotalFees),
|
TotalFees: int64(route.TotalFees),
|
||||||
@ -1578,7 +1584,7 @@ func (r *rpcServer) QueryRoute(_ context.Context, in *lnrpc.RouteRequest) (*lnrp
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return resp, nil
|
return resp
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetNetworkInfo returns some basic stats about the known channel graph from
|
// GetNetworkInfo returns some basic stats about the known channel graph from
|
||||||
|
@ -231,6 +231,8 @@ func (u *utxoNursery) catchUpKindergarten() error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
utxnLog.Infof("UTXO Nursery is now fully synced")
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user