common/features: understand the route_blinding feature (feature 24)

We don't set it, but we know how to now.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-10-17 11:14:26 +10:30
parent c0ae2394d8
commit c94c742e58
2 changed files with 18 additions and 2 deletions

View File

@@ -109,6 +109,11 @@ static const struct feature_style feature_styles[] = {
[NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT, [NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT,
[BOLT11_FEATURE] = FEATURE_DONT_REPRESENT, [BOLT11_FEATURE] = FEATURE_DONT_REPRESENT,
[CHANNEL_FEATURE] = FEATURE_DONT_REPRESENT} }, [CHANNEL_FEATURE] = FEATURE_DONT_REPRESENT} },
{ OPT_ROUTE_BLINDING,
.copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT,
[NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT,
[BOLT11_FEATURE] = FEATURE_REPRESENT,
[CHANNEL_FEATURE] = FEATURE_DONT_REPRESENT } },
{ OPT_SHUTDOWN_ANYSEGWIT, { OPT_SHUTDOWN_ANYSEGWIT,
.copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT, .copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT,
[NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT, [NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT,
@@ -168,6 +173,12 @@ static const struct dependency feature_deps[] = {
* `option_dual_fund` | ... | ... | `option_anchor_outputs` * `option_dual_fund` | ... | ... | `option_anchor_outputs`
*/ */
{ OPT_DUAL_FUND, OPT_ANCHOR_OUTPUTS }, { OPT_DUAL_FUND, OPT_ANCHOR_OUTPUTS },
/* BOLT-route-blinding #9:
* Name | Description | Context | Dependencies |
* ...
* `option_route_blinding` | ... | ... | `var_onion_optin`
*/
{ OPT_ROUTE_BLINDING, OPT_VAR_ONION },
}; };
static void trim_features(u8 **features) static void trim_features(u8 **features)
@@ -436,7 +447,7 @@ const char *feature_name(const tal_t *ctx, size_t f)
"option_support_large_channel", "option_support_large_channel",
"option_anchor_outputs", /* 20/21 */ "option_anchor_outputs", /* 20/21 */
"option_anchors_zero_fee_htlc_tx", "option_anchors_zero_fee_htlc_tx",
"option_trampoline_routing", /* https://github.com/lightning/bolts/pull/836 */ "option_route_blinding", /* https://github.com/lightning/bolts/pull/765 */
"option_shutdown_anysegwit", "option_shutdown_anysegwit",
"option_dual_fund", "option_dual_fund",
"option_amp", /* 30/31 */ /* https://github.com/lightning/bolts/pull/658 */ "option_amp", /* 30/31 */ /* https://github.com/lightning/bolts/pull/658 */
@@ -452,7 +463,7 @@ const char *feature_name(const tal_t *ctx, size_t f)
"option_zeroconf", /* 50/51, https://github.com/lightning/bolts/pull/910 */ "option_zeroconf", /* 50/51, https://github.com/lightning/bolts/pull/910 */
NULL, NULL,
"option_keysend", "option_keysend",
NULL, "option_trampoline_routing", /* https://github.com/lightning/bolts/pull/836 */
NULL, NULL,
NULL, /* 60/61 */ NULL, /* 60/61 */
NULL, NULL,

View File

@@ -132,6 +132,11 @@ struct feature_set *feature_set_dup(const tal_t *ctx,
#define OPT_CHANNEL_TYPE 44 #define OPT_CHANNEL_TYPE 44
#define OPT_PAYMENT_METADATA 48 #define OPT_PAYMENT_METADATA 48
/* BOLT-route-blinding #9:
* | 24/25 | `option_route_blinding` | Node supports blinded paths | IN9 | `var_onion_optin` | ...
*/
#define OPT_ROUTE_BLINDING 24
/* BOLT-f53ca2301232db780843e894f55d95d512f297f9 #9: /* BOLT-f53ca2301232db780843e894f55d95d512f297f9 #9:
* | 28/29 | `option_dual_fund` | ... IN9 ... * | 28/29 | `option_dual_fund` | ... IN9 ...
*/ */