mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-04 20:44:46 +02:00
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:
2
peer.go
2
peer.go
@ -927,7 +927,9 @@ func (p *peer) logWireMessage(msg lnwire.Message, read bool) {
|
|||||||
|
|
||||||
switch m := msg.(type) {
|
switch m := msg.(type) {
|
||||||
case *lnwire.ChannelReestablish:
|
case *lnwire.ChannelReestablish:
|
||||||
|
if m.LocalUnrevokedCommitPoint != nil {
|
||||||
m.LocalUnrevokedCommitPoint.Curve = nil
|
m.LocalUnrevokedCommitPoint.Curve = nil
|
||||||
|
}
|
||||||
case *lnwire.RevokeAndAck:
|
case *lnwire.RevokeAndAck:
|
||||||
m.NextRevocationKey.Curve = nil
|
m.NextRevocationKey.Curve = nil
|
||||||
case *lnwire.NodeAnnouncement:
|
case *lnwire.NodeAnnouncement:
|
||||||
|
Reference in New Issue
Block a user