mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
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:
committed by
Rusty Russell
parent
8d6c8c3cd1
commit
ebd3a8d7f2
@@ -191,7 +191,7 @@ static void gossip_topology_synced(struct chain_topology *topo, void *unused)
|
|||||||
* message */
|
* message */
|
||||||
void gossip_init(struct lightningd *ld, int connectd_fd)
|
void gossip_init(struct lightningd *ld, int connectd_fd)
|
||||||
{
|
{
|
||||||
u8 *msg;
|
u8 *msg, *node_featurebits;
|
||||||
int hsmfd;
|
int hsmfd;
|
||||||
|
|
||||||
hsmfd = hsm_get_global_fd(ld, HSM_CAP_SIGN_GOSSIP);
|
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,
|
topology_add_sync_waiter(ld->gossip, ld->topology,
|
||||||
gossip_topology_synced, NULL);
|
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(
|
msg = towire_gossipctl_init(
|
||||||
tmpctx,
|
tmpctx,
|
||||||
chainparams,
|
chainparams,
|
||||||
&ld->id,
|
&ld->id,
|
||||||
get_offered_nodefeatures(tmpctx),
|
node_featurebits,
|
||||||
ld->rgb,
|
ld->rgb,
|
||||||
ld->alias,
|
ld->alias,
|
||||||
ld->announcable,
|
ld->announcable,
|
||||||
|
|||||||
@@ -826,7 +826,6 @@ def test_libplugin(node_factory):
|
|||||||
assert l1.rpc.call("testrpc") == l1.rpc.getinfo()
|
assert l1.rpc.call("testrpc") == l1.rpc.getinfo()
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail(strict=True)
|
|
||||||
@unittest.skipIf(not DEVELOPER, "needs LIGHTNINGD_DEV_LOG_IO")
|
@unittest.skipIf(not DEVELOPER, "needs LIGHTNINGD_DEV_LOG_IO")
|
||||||
def test_plugin_feature_announce(node_factory):
|
def test_plugin_feature_announce(node_factory):
|
||||||
"""Check that features registered by plugins show up in messages.
|
"""Check that features registered by plugins show up in messages.
|
||||||
|
|||||||
Reference in New Issue
Block a user