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.
This commit is contained in:
parent
7a3116f8a9
commit
ce6dee6ee4
4
peer.go
4
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:
|
||||
|
Loading…
Reference in New Issue
Block a user