From e549746578157eb636b2e2e176e0c6d7d0abfdd0 Mon Sep 17 00:00:00 2001 From: niftynei Date: Thu, 11 Mar 2021 18:21:58 -0600 Subject: [PATCH] features: match up feature names to feature bit Aligns the feature bit number to the name-label. Is this correct? --- common/features.c | 45 +++++++++++++++++++++++++++++++++++++++++---- tests/test_misc.py | 2 +- 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/common/features.c b/common/features.c index 387a00ecb..2ea1c0403 100644 --- a/common/features.c +++ b/common/features.c @@ -380,21 +380,58 @@ int features_unsupported(const struct feature_set *our_features, static const char *feature_name(const tal_t *ctx, size_t f) { static const char *fnames[] = { - "option_data_loss_protect", + "option_data_loss_protect", /* 0/1 */ "option_initial_routing_sync", "option_upfront_shutdown_script", "option_gossip_queries", "option_var_onion_optin", - "option_gossip_queries_ex", + "option_gossip_queries_ex", /* 10/11 */ "option_static_remotekey", "option_payment_secret", "option_basic_mpp", "option_support_large_channel", - "option_anchor_outputs", - "option_dual_fund", + "option_anchor_outputs", /* 20/21 */ "option_anchors_zero_fee_htlc_tx", NULL, "option_shutdown_anysegwit", + "option_dual_fund", + NULL, /* 30/31 */ + NULL, + NULL, + NULL, + NULL, + NULL, /* 40/41 */ + NULL, + NULL, + NULL, + NULL, + NULL, /* 50/51 */ + NULL, + NULL, + NULL, + NULL, + NULL, /* 60/61 */ + NULL, + NULL, + NULL, + NULL, + NULL, /* 70/71 */ + NULL, + NULL, + NULL, + NULL, + NULL, /* 80/81 */ + NULL, + NULL, + NULL, + NULL, + NULL, /* 90/91 */ + NULL, + NULL, + NULL, + NULL, + NULL, /* 100/101 */ + "option_onion_messages", /* 102/103 */ }; if (f / 2 >= ARRAY_SIZE(fnames) || !fnames[f / 2]) diff --git a/tests/test_misc.py b/tests/test_misc.py index a6c4fb358..e45aff0b0 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -1897,7 +1897,7 @@ def test_list_features_only(node_factory): if EXPERIMENTAL_FEATURES: expected += ['option_anchor_outputs/odd'] expected += ['option_shutdown_anysegwit/odd'] - expected += ['option_unknown_102/odd'] + expected += ['option_onion_messages/odd'] assert features == expected