From ce6dee6ee4c3d4b161db65058c8afa4f541bae1f Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 7 Dec 2017 13:11:23 -0800 Subject: [PATCH] peer: check LocalUnrevokedCommitPoint for nil-ness as it's optional In this commit, we modify the logWireMessage function to ensure that we don't attempt to nil out the LocalUnrevokedCommitPoint.Curve field unless it's actually set. We need to do this as the field as actually optional, and we may be reading a message from a node that doesn't support the option. Fixes #461. --- peer.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/peer.go b/peer.go index 481359f1b..bf0ba538b 100644 --- a/peer.go +++ b/peer.go @@ -927,7 +927,9 @@ func (p *peer) logWireMessage(msg lnwire.Message, read bool) { switch m := msg.(type) { case *lnwire.ChannelReestablish: - m.LocalUnrevokedCommitPoint.Curve = nil + if m.LocalUnrevokedCommitPoint != nil { + m.LocalUnrevokedCommitPoint.Curve = nil + } case *lnwire.RevokeAndAck: m.NextRevocationKey.Curve = nil case *lnwire.NodeAnnouncement: