openingd: channel_type TLV no longer experimental.

It was merged (but this doesn't update the BOLT quotes, that's in another patch).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: Protocol: We now send and support channel_type in channel open (not dual-funding though).
This commit is contained in:
Rusty Russell 2021-09-10 11:44:23 +09:30 committed by Christian Decker
parent c121fc9fcf
commit 65290c02ba

View file

@ -380,7 +380,6 @@ static u8 *funder_channel_start(struct state *state, u8 channel_flags)
open_tlvs->upfront_shutdown_script open_tlvs->upfront_shutdown_script
= state->upfront_shutdown_script[LOCAL]; = state->upfront_shutdown_script[LOCAL];
#if EXPERIMENTAL_FEATURES
/* BOLT-channel-types #2: /* BOLT-channel-types #2:
* - if it includes `channel_type`: * - if it includes `channel_type`:
* - MUST set it to a defined type representing the type it wants. * - MUST set it to a defined type representing the type it wants.
@ -390,7 +389,6 @@ static u8 *funder_channel_start(struct state *state, u8 channel_flags)
* negotiated. * negotiated.
*/ */
open_tlvs->channel_type = state->channel_type->features; open_tlvs->channel_type = state->channel_type->features;
#endif
msg = towire_open_channel(NULL, msg = towire_open_channel(NULL,
&chainparams->genesis_blockhash, &chainparams->genesis_blockhash,
@ -453,7 +451,6 @@ static u8 *funder_channel_start(struct state *state, u8 channel_flags)
} }
set_remote_upfront_shutdown(state, accept_tlvs->upfront_shutdown_script); set_remote_upfront_shutdown(state, accept_tlvs->upfront_shutdown_script);
#if EXPERIMENTAL_FEATURES
/* BOLT-channel-types #2: /* BOLT-channel-types #2:
* - if `channel_type` is set, and `channel_type` was set in * - if `channel_type` is set, and `channel_type` was set in
* `open_channel`, and they are not equal types: * `open_channel`, and they are not equal types:
@ -468,7 +465,7 @@ static u8 *funder_channel_start(struct state *state, u8 channel_flags)
accept_tlvs->channel_type)); accept_tlvs->channel_type));
return NULL; return NULL;
} }
#endif /* EXPERIMENTAL_FEATURES */
/* BOLT #2: /* BOLT #2:
* *
* The `temporary_channel_id` MUST be the same as the * The `temporary_channel_id` MUST be the same as the
@ -839,7 +836,6 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
= default_channel_type(state, = default_channel_type(state,
state->our_features, state->their_features); state->our_features, state->their_features);
#if EXPERIMENTAL_FEATURES
/* BOLT-channel-types #2: /* BOLT-channel-types #2:
* The receiving node MUST fail the channel if: * The receiving node MUST fail the channel if:
*... *...
@ -857,7 +853,6 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
open_tlvs->channel_type)); open_tlvs->channel_type));
return NULL; return NULL;
} }
#endif
/* BOLT #2: /* BOLT #2:
* *
@ -1022,13 +1017,11 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
accept_tlvs = tlv_accept_channel_tlvs_new(tmpctx); accept_tlvs = tlv_accept_channel_tlvs_new(tmpctx);
accept_tlvs->upfront_shutdown_script accept_tlvs->upfront_shutdown_script
= state->upfront_shutdown_script[LOCAL]; = state->upfront_shutdown_script[LOCAL];
#if EXPERIMENTAL_FEATURES
/* BOLT-channel-types #2: /* BOLT-channel-types #2:
* - if it sets `channel_type`: * - if it sets `channel_type`:
* - MUST set it to the `channel_type` from `open_channel` * - MUST set it to the `channel_type` from `open_channel`
*/ */
accept_tlvs->channel_type = state->channel_type->features; accept_tlvs->channel_type = state->channel_type->features;
#endif
msg = towire_accept_channel(NULL, &state->channel_id, msg = towire_accept_channel(NULL, &state->channel_id,
state->localconf.dust_limit, state->localconf.dust_limit,