common/channel_type: fix up bolt quotes now channel-types is merged.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2021-09-10 11:44:24 +09:30 committed by Christian Decker
parent 027b11a5ab
commit acef45d02e
2 changed files with 9 additions and 9 deletions

View File

@ -1,7 +1,7 @@
#include <ccan/array_size/array_size.h>
#include <common/channel_type.h>
/* BOLT-channel-types #2:
/* BOLT #2:
* Channel types are an explicit enumeration: for convenience of future
* definitions they reuse even feature bits, but they are not an
* arbitrary combination (they represent the persistent features which
@ -46,13 +46,13 @@ struct channel_type *default_channel_type(const tal_t *ctx,
const struct feature_set *our_features,
const u8 *their_features)
{
/* BOLT-channel-types #2:
/* BOLT #2:
* Both peers:
* - if `channel_type` was present in both `open_channel` and `accept_channel`:
* - This is the `channel_type` (they must be equal, required above)
* - otherwise:
*/
/* BOLT-channel-types #2:
/* BOLT #2:
* - otherwise, if `option_anchor_outputs` was negotiated:
* - the `channel_type` is `option_anchor_outputs` and
* `option_static_remotekey` (bits 20 and 12)
@ -60,14 +60,14 @@ struct channel_type *default_channel_type(const tal_t *ctx,
if (feature_negotiated(our_features, their_features,
OPT_ANCHOR_OUTPUTS))
return channel_type_anchor_outputs(ctx);
/* BOLT-channel-types #2:
/* BOLT #2:
* - otherwise, if `option_static_remotekey` was negotiated:
* - the `channel_type` is `option_static_remotekey` (bit 12)
*/
else if (feature_negotiated(our_features, their_features,
OPT_STATIC_REMOTEKEY))
return channel_type_static_remotekey(ctx);
/* BOLT-channel-types #2:
/* BOLT #2:
* - otherwise:
* - the `channel_type` is empty
*/

View File

@ -380,7 +380,7 @@ static u8 *funder_channel_start(struct state *state, u8 channel_flags)
open_tlvs->upfront_shutdown_script
= state->upfront_shutdown_script[LOCAL];
/* BOLT-channel-types #2:
/* BOLT #2:
* - if it includes `channel_type`:
* - MUST set it to a defined type representing the type it wants.
* - MUST use the smallest bitmap possible to represent the channel
@ -451,7 +451,7 @@ static u8 *funder_channel_start(struct state *state, u8 channel_flags)
}
set_remote_upfront_shutdown(state, accept_tlvs->upfront_shutdown_script);
/* BOLT-channel-types #2:
/* BOLT #2:
* - if `channel_type` is set, and `channel_type` was set in
* `open_channel`, and they are not equal types:
* - MUST reject the channel.
@ -834,7 +834,7 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
"Parsing open_channel %s", tal_hex(tmpctx, open_channel_msg));
set_remote_upfront_shutdown(state, open_tlvs->upfront_shutdown_script);
/* BOLT-channel-types #2:
/* BOLT #2:
* The receiving node MUST fail the channel if:
*...
* - It supports `channel_type`, `channel_type` was set, and the
@ -1022,7 +1022,7 @@ static u8 *fundee_channel(struct state *state, const u8 *open_channel_msg)
accept_tlvs = tlv_accept_channel_tlvs_new(tmpctx);
accept_tlvs->upfront_shutdown_script
= state->upfront_shutdown_script[LOCAL];
/* BOLT-channel-types #2:
/* BOLT #2:
* - if it sets `channel_type`:
* - MUST set it to the `channel_type` from `open_channel`
*/