Browse Source

libplugin: It's featurebits, not features

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.
nifty/pset-pre
Christian Decker 5 years ago
committed by neil saitug
parent
commit
9f298330b2
  1. 4
      doc/PLUGINS.md
  2. 2
      plugins/libplugin.c
  3. 1
      tests/test_pay.py

4
doc/PLUGINS.md

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

2
plugins/libplugin.c

@ -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];

1
tests/test_pay.py

@ -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')

Loading…
Cancel
Save