Browse Source

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
travis-debug
Christian Decker 5 years ago
committed by Rusty Russell
parent
commit
ebd3a8d7f2
  1. 9
      lightningd/gossip_control.c
  2. 1
      tests/test_plugin.py

9
lightningd/gossip_control.c

@ -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,

1
tests/test_plugin.py

@ -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.

Loading…
Cancel
Save