chan_series: filter out nodes who intend to remain private

In this commit, we filter out nodes who intend to remain private. We do
this to prevent leaking information about them by forwarding their
NodeAnnouncements.
This commit is contained in:
Wilmer Paulino 2018-10-17 16:09:34 -07:00
parent 85cdb18b73
commit cbab298154
No known key found for this signature in database
GPG Key ID: 6DF57B9F9514972F

@ -89,6 +89,22 @@ func (c *chanSeries) UpdatesInHorizon(chain chainhash.Hash,
return nil, err
}
for _, nodeAnn := range nodeAnnsInHorizon {
// Ensure we only forward nodes that are publicly advertised to
// prevent leaking information about nodes.
isNodePublic, err := c.graph.IsPublicNode(nodeAnn.PubKeyBytes)
if err != nil {
srvrLog.Errorf("Unable to determine if node %x is "+
"advertised: %v", nodeAnn.PubKeyBytes, err)
continue
}
if !isNodePublic {
srvrLog.Tracef("Skipping forwarding announcement for "+
"node %x due to being unadvertised",
nodeAnn.PubKeyBytes)
continue
}
nodeUpdate, err := nodeAnn.NodeAnnouncement(true)
if err != nil {
return nil, err