Skip to content

Commit

Permalink
common/channel_type: fix up bolt quotes now channel-types is merged.
Browse files Browse the repository at this point in the history
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell authored and cdecker committed Sep 13, 2021
1 parent 027b11a commit acef45d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions common/channel_type.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -46,28 +46,28 @@ 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)
*/
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
*/
Expand Down
8 changes: 4 additions & 4 deletions openingd/openingd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`
*/
Expand Down

0 comments on commit acef45d

Please sign in to comment.