routing: prevent logging the public key params within the routing hints

This commit is contained in:
Wilmer Paulino 2018-03-27 00:03:15 -04:00
parent 1e5659e5f4
commit 5ddee85479
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F

@ -1505,7 +1505,14 @@ type LightningPayment struct {
func (r *ChannelRouter) SendPayment(payment *LightningPayment) ([32]byte, *Route, error) { func (r *ChannelRouter) SendPayment(payment *LightningPayment) ([32]byte, *Route, error) {
log.Tracef("Dispatching route for lightning payment: %v", log.Tracef("Dispatching route for lightning payment: %v",
newLogClosure(func() string { newLogClosure(func() string {
// Remove the public key curve parameters when logging
// the route to prevent spamming the logs.
payment.Target.Curve = nil payment.Target.Curve = nil
for _, routeHint := range payment.RouteHints {
for _, hopHint := range routeHint {
hopHint.NodeID.Curve = nil
}
}
return spew.Sdump(payment) return spew.Sdump(payment)
}), }),
) )