Browse Source

gossipd: allow node_announcements and channel_announcements with unsupported 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 <rusty@rustcorp.com.au>
travis-debug
Rusty Russell 5 years ago
committed by Christian Decker
parent
commit
5df9e5b7b4
  1. 32
      gossipd/routing.c

32
gossipd/routing.c

@ -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:
*...
@ -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)) {

Loading…
Cancel
Save