Skip to content

Commit

Permalink
libplugin: It's featurebits, not features
Browse files Browse the repository at this point in the history
The documentation was wrong, and I copied my mistake to `libplugin` where it
was then ignored instead of ORed into the node's featurebits. This fixes both.
  • Loading branch information
cdecker authored and niftynei committed Apr 28, 2020
1 parent 8c23f22 commit 9f29833
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions doc/PLUGINS.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ The `dynamic` indicates if the plugin can be managed after `lightningd`
has been started. Critical plugins that should not be stopped should set it
to false.

The `features` object allows the plugin to register featurebits that should be
The `featurebits` object allows the plugin to register featurebits that should be
announced in a number of places in [the protocol][bolt9]. They can be used to signal
support for custom protocol extensions to direct peers, remote nodes and in
invoices. Custom protocol extensions can be implemented for example using the
`sendcustommsg` method and the `custommsg` hook, or the `sendonion` method and
the `htlc_accepted` hook. The keys in the `features` object are `node` for
the `htlc_accepted` hook. The keys in the `featurebits` object are `node` for
features that should be announced via the `node_announcement` to all nodes in
the network, `init` for features that should be announced to direct peers
during the connection setup, `channel` for features which should apply to `channel_announcement`, and `invoice` for features that should be
Expand Down
2 changes: 1 addition & 1 deletion plugins/libplugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ handle_getmanifest(struct command *getmanifest_cmd)
json_array_end(params);

if (p->our_features != NULL) {
json_object_start(params, "features");
json_object_start(params, "featurebits");
for (size_t i = 0; i < NUM_FEATURE_PLACE; i++) {
u8 *f = p->our_features->bits[i];
const char *fieldname = feature_place_names[i];
Expand Down
1 change: 0 additions & 1 deletion tests/test_pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -2961,7 +2961,6 @@ def test_excluded_adjacent_routehint(node_factory, bitcoind):
l1.rpc.pay(bolt11=inv['bolt11'], maxfeepercent=0, exemptfee=0)


@pytest.mark.xfail(strict=True)
def test_keysend(node_factory):
# Use a temporary python plugin until we implement a native one
plugin_path = os.path.join(os.getcwd(), 'tests/plugins/keysend.py')
Expand Down

0 comments on commit 9f29833

Please sign in to comment.