From c94c742e581f767e16f5c7f41afe4c82873a2cb5 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 17 Oct 2022 11:14:26 +1030 Subject: [PATCH] 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 --- common/features.c | 15 +++++++++++++-- common/features.h | 5 +++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/common/features.c b/common/features.c index 05c5b39fb..1295cf3dc 100644 --- a/common/features.c +++ b/common/features.c @@ -109,6 +109,11 @@ static const struct feature_style feature_styles[] = { [NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT, [BOLT11_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, .copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT, [NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT, @@ -168,6 +173,12 @@ static const struct dependency feature_deps[] = { * `option_dual_fund` | ... | ... | `option_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) @@ -436,7 +447,7 @@ const char *feature_name(const tal_t *ctx, size_t f) "option_support_large_channel", "option_anchor_outputs", /* 20/21 */ "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_dual_fund", "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 */ NULL, "option_keysend", - NULL, + "option_trampoline_routing", /* https://github.com/lightning/bolts/pull/836 */ NULL, NULL, /* 60/61 */ NULL, diff --git a/common/features.h b/common/features.h index ccb914020..02c58d6f2 100644 --- a/common/features.h +++ b/common/features.h @@ -132,6 +132,11 @@ struct feature_set *feature_set_dup(const tal_t *ctx, #define OPT_CHANNEL_TYPE 44 #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: * | 28/29 | `option_dual_fund` | ... IN9 ... */