routing: Require adding edge to node before adding node.

This commit introduces the requirement specified in BOLT#7,
where we ignore any node announcements for a specific node
if we yet haven't seen any channel announcements where this
node takes part. This is to prevent someone DoS-ing the
network with cheap node announcements. In the router this
is enforced by requiring a call to AddNode(node_id) to
be preceded by an AddEdge(edge_id) call, where node_id is
one of the nodes in edge_id.
This commit is contained in:
Johan T. Halseth authored and Olaoluwa Osuntokun committed 2017-08-02 15:58:58 -07:00
1 parent bd0465ee1d
commit 39a59bbe6f
5 files changed
+423 -78

No files matched your search

+2 -1
View File
@@ -35,7 +35,8 @@ const (
ErrOutdated
// ErrIgnored is returned when the update have been ignored because
// this update can't bring us something new.
// this update can't bring us something new, or because a node
// announcement was given for node not found in any channel.
ErrIgnored
)