From 649762bf7f6ee2dcde61e250e7322caa13f65268 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 13 Aug 2020 10:40:26 +0930 Subject: [PATCH] features: define option_anchor_outputs. As specified by https://github.com/lightningnetwork/lightning-rfc/pull/688. Signed-off-by: Rusty Russell --- common/features.c | 14 ++++++++++++++ common/features.h | 6 ++++++ 2 files changed, 20 insertions(+) diff --git a/common/features.c b/common/features.c index ebf14fbdd980..1b2ecdd27001 100644 --- a/common/features.c +++ b/common/features.c @@ -69,6 +69,10 @@ static const struct feature_style feature_styles[] = { [NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT, [CHANNEL_FEATURE] = FEATURE_DONT_REPRESENT } }, #if EXPERIMENTAL_FEATURES + { OPT_ANCHOR_OUTPUTS, + .copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT, + [NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT, + [CHANNEL_FEATURE] = FEATURE_DONT_REPRESENT } }, { OPT_ONION_MESSAGES, .copy_style = { [INIT_FEATURE] = FEATURE_REPRESENT, [NODE_ANNOUNCE_FEATURE] = FEATURE_REPRESENT, @@ -95,6 +99,14 @@ static const struct dependency feature_deps[] = { { OPT_GOSSIP_QUERIES_EX, OPT_GOSSIP_QUERIES }, { OPT_PAYMENT_SECRET, OPT_VAR_ONION }, { OPT_BASIC_MPP, OPT_PAYMENT_SECRET }, + /* BOLT-a12da24dd0102c170365124782b46d9710950ac1 #9: + * Name | Description | Context | Dependencies | + *... + * `option_anchor_outputs` | ... | ... | `option_static_remotekey` + */ +#if EXPERIMENTAL_FEATURES + { OPT_ANCHOR_OUTPUTS, OPT_STATIC_REMOTEKEY }, +#endif }; static enum feature_copy_style feature_copy_style(u32 f, enum feature_place p) @@ -315,6 +327,8 @@ static const char *feature_name(const tal_t *ctx, size_t f) "option_static_remotekey", "option_payment_secret", "option_basic_mpp", + "option_support_large_channel", + "option_anchor_outputs", }; if (f / 2 >= ARRAY_SIZE(fnames)) diff --git a/common/features.h b/common/features.h index 9ccd73cc3062..f346fd016c37 100644 --- a/common/features.h +++ b/common/features.h @@ -107,6 +107,12 @@ u8 *featurebits_or(const tal_t *ctx, const u8 *f1 TAKES, const u8 *f2 TAKES); #define OPT_BASIC_MPP 16 #define OPT_LARGE_CHANNELS 18 +/* BOLT-a12da24dd0102c170365124782b46d9710950ac1 #9: + * + * | 20/21 | `option_anchor_outputs` |... IN ... + */ +#define OPT_ANCHOR_OUTPUTS 20 + /* BOLT-9fc25cfd2895578c0b1ab701ebe6c1eb67a19623 #9: * * | 102/103 | `option_onion_messages` |... INC+ ...