plugin: Add featurebits registered by plugins to node_announcements

This is the last venue we need to add custom featurebits to, so we also unmark
the test as xfail.

Changelog-Added: plugin: Plugins can now signal support for experimental protocol extensions by registering featurebits for `node_announcement`s, the connection handshake, and for invoices. For now this is limited to non-dynamic plugins only
This commit is contained in:
Christian Decker
2020-01-31 15:24:32 +01:00
committed by Rusty Russell
parent 8d6c8c3cd1
commit ebd3a8d7f2
2 changed files with 7 additions and 3 deletions

View File

@@ -191,7 +191,7 @@ static void gossip_topology_synced(struct chain_topology *topo, void *unused)
* message */
void gossip_init(struct lightningd *ld, int connectd_fd)
{
u8 *msg;
u8 *msg, *node_featurebits;
int hsmfd;
hsmfd = hsm_get_global_fd(ld, HSM_CAP_SIGN_GOSSIP);
@@ -206,11 +206,16 @@ void gossip_init(struct lightningd *ld, int connectd_fd)
topology_add_sync_waiter(ld->gossip, ld->topology,
gossip_topology_synced, NULL);
node_featurebits =
featurebits_or(tmpctx, take(get_offered_nodefeatures(tmpctx)),
take(plugins_collect_featurebits(
tmpctx, ld->plugins, PLUGIN_FEATURES_NODE)));
msg = towire_gossipctl_init(
tmpctx,
chainparams,
&ld->id,
get_offered_nodefeatures(tmpctx),
node_featurebits,
ld->rgb,
ld->alias,
ld->announcable,

View File

@@ -826,7 +826,6 @@ def test_libplugin(node_factory):
assert l1.rpc.call("testrpc") == l1.rpc.getinfo()
@pytest.mark.xfail(strict=True)
@unittest.skipIf(not DEVELOPER, "needs LIGHTNINGD_DEV_LOG_IO")
def test_plugin_feature_announce(node_factory):
"""Check that features registered by plugins show up in messages.