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,7 +206,18 @@ func (r *mockGraphSource) IsStaleNode(nodePub routing.Vertex, timestamp time.Tim
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false
|
// 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
|
// IsPublicNode determines whether the given vertex is seen as a public node in
|
||||||
|
Loading…
Reference in New Issue
Block a user