mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 09:53:54 +01: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:
parent
85cdb18b73
commit
cbab298154
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user