Skip to content

Commit

Permalink
features: define option_anchor_outputs.
Browse files Browse the repository at this point in the history
As specified by lightning/bolts#688.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Aug 13, 2020
1 parent 6da3d71 commit e0bad48
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions common/features.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)
Expand Down Expand Up @@ -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))
Expand Down
6 changes: 6 additions & 0 deletions common/features.h
Original file line number Diff line number Diff line change
Expand Up @@ -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+ ...
Expand Down

0 comments on commit e0bad48

Please sign in to comment.