mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-28 13:52:55 +02:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user