discovery/gossiper test: define unknown node announcement as stal
To mimic the current behaviour of the router's IsStaleNode, we make the mockGraphSource consider a unknown node with no channels in the graph as stale.
This commit is contained in:
parent
832bd8101c
commit
2911944e5a
@ -206,8 +206,19 @@ func (r *mockGraphSource) IsStaleNode(nodePub routing.Vertex, timestamp time.Tim
|
||||
}
|
||||
}
|
||||
|
||||
// If we did not find the node among our existing graph nodes, we
|
||||
// require the node to already have a channel in the graph to not be
|
||||
// considered stale.
|
||||
for _, info := range r.infos {
|
||||
if info.NodeKey1Bytes == nodePub {
|
||||
return false
|
||||
}
|
||||
if info.NodeKey2Bytes == nodePub {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// IsPublicNode determines whether the given vertex is seen as a public node in
|
||||
// the graph from the graph's source node's point of view.
|
||||
|
Loading…
Reference in New Issue
Block a user