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:
Olaoluwa Osuntokun 2017-01-16 20:41:32 -08:00
parent 765d9fd5e9
commit 7d6d8187fb
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2
2 changed files with 11 additions and 3 deletions

@ -915,7 +915,9 @@ func (r *rpcServer) SendPayment(paymentStream lnrpc.Lightning_SendPaymentServer)
}
// TODO(roasbeef): proper responses
resp := &lnrpc.SendResponse{}
resp := &lnrpc.SendResponse{
PaymentRoute: marshalRoute(route),
}
if err := paymentStream.Send(resp); err != nil {
errChan <- err
return
@ -1560,9 +1562,13 @@ func (r *rpcServer) QueryRoute(_ context.Context, in *lnrpc.RouteRequest) (*lnrp
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
// the RPC system.
return marshalRoute(route), nil
}
func marshalRoute(route *routing.Route) *lnrpc.Route {
resp := &lnrpc.Route{
TotalTimeLock: route.TotalTimeLock,
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

@ -231,6 +231,8 @@ func (u *utxoNursery) catchUpKindergarten() error {
}
}
utxnLog.Infof("UTXO Nursery is now fully synced")
return nil
}