Skip to content

Commit

Permalink
gossipd: allow node_announcements and channel_announcements with unsu…
Browse files Browse the repository at this point in the history
…pported features.

The flat feature PR changes the rules so these are OK to propagate.
That makes sense: the unsupported features means there's something
unsupported about the *node* or *channel*, not the msg itself
(for that we'd use a different message type).

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Nov 10, 2019
1 parent c62f0cb commit 5df9e5b
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions gossipd/routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -1761,22 +1761,6 @@ u8 *handle_channel_announcement(struct routing_state *rstate,

/* FIXME: Handle duplicates as per BOLT #7 */

/* BOLT #7:
*
* - if `features` field contains _unknown even bits_:
* - MUST NOT parse the remainder of the message.
* - MAY discard the message altogether.
* - SHOULD NOT connect to the node.
* - MAY forward `node_announcement`s that contain an _unknown_
* `features` _bit_, regardless of if it has parsed the announcement
* or not.
*/
if (!features_supported(features)) {
status_debug("Ignoring channel announcement, unsupported features %s.",
tal_hex(pending, features));
goto ignored;
}

/* BOLT #7:
* The receiving node:
*...
Expand Down Expand Up @@ -2574,22 +2558,6 @@ u8 *handle_node_announcement(struct routing_state *rstate, const u8 *node_ann,
return err;
}

/* BOLT #7:
*
* The receiving node:
*...
* - if `features` field contains _unknown even bits_:
* - MUST NOT parse the remainder of the message.
* - MAY discard the message altogether.
* - SHOULD NOT connect to the node.
*/
if (!features_supported(features)) {
status_debug("Ignoring node announcement for node %s, unsupported features %s.",
type_to_string(tmpctx, struct node_id, &node_id),
tal_hex(tmpctx, features));
return NULL;
}

sha256_double(&hash, serialized + 66, tal_count(serialized) - 66);
/* If node_id is invalid, it fails here */
if (!check_signed_hash_nodeid(&hash, &signature, &node_id)) {
Expand Down

0 comments on commit 5df9e5b

Please sign in to comment.