From 5dcd2a453062853863772da5147289ad6d47f851 Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Wed, 10 Oct 2018 15:05:21 +0200 Subject: [PATCH] gossiper: validate our own node announement --- discovery/gossiper.go | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/discovery/gossiper.go b/discovery/gossiper.go index e488e220..b74a2f65 100644 --- a/discovery/gossiper.go +++ b/discovery/gossiper.go @@ -1577,22 +1577,20 @@ func (d *AuthenticatedGossiper) processNetworkAnnouncement( case *lnwire.NodeAnnouncement: timestamp := time.Unix(int64(msg.Timestamp), 0) - if nMsg.isRemote { - // We'll quickly ask the router if it already has a - // newer update for this node so we can skip validating - // signatures if not required. - if d.cfg.Router.IsStaleNode(msg.NodeID, timestamp) { - nMsg.err <- nil - return nil - } + // We'll quickly ask the router if it already has a + // newer update for this node so we can skip validating + // signatures if not required. + if d.cfg.Router.IsStaleNode(msg.NodeID, timestamp) { + nMsg.err <- nil + return nil + } - if err := routing.ValidateNodeAnn(msg); err != nil { - err := fmt.Errorf("unable to validate "+ - "node announcement: %v", err) - log.Error(err) - nMsg.err <- err - return nil - } + if err := routing.ValidateNodeAnn(msg); err != nil { + err := fmt.Errorf("unable to validate "+ + "node announcement: %v", err) + log.Error(err) + nMsg.err <- err + return nil } features := lnwire.NewFeatureVector(