routing: check to see if pubkey is nil before logging in sendPayment

In this commit, we now need to check to see if the pubkey is nil as if
the user specified a set of manual routes, then the dest pubkey would be
empty.
This commit is contained in:
Olaoluwa Osuntokun 2018-06-06 20:38:46 -07:00
parent 0113035f6d
commit eb65b0cd5a
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -1584,7 +1584,10 @@ func (r *ChannelRouter) sendPayment(payment *LightningPayment,
newLogClosure(func() string {
// Remove the public key curve parameters when logging
// the route to prevent spamming the logs.
payment.Target.Curve = nil
if payment.Target != nil {
payment.Target.Curve = nil
}
for _, routeHint := range payment.RouteHints {
for _, hopHint := range routeHint {
hopHint.NodeID.Curve = nil