1
0
mirror of https://github.com/lightning/bolts.git synced 2024-11-19 01:50:03 +01:00

BOLT #7: rename message_flags to must_be_one.

Suggested-by: @t-bast
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2022-06-01 09:43:20 +09:30
parent 466317a300
commit f99b5494c8

View File

@ -407,7 +407,7 @@ of *relaying* payments, not *sending* payments. When making a payment
* [`chain_hash`:`chain_hash`] * [`chain_hash`:`chain_hash`]
* [`short_channel_id`:`short_channel_id`] * [`short_channel_id`:`short_channel_id`]
* [`u32`:`timestamp`] * [`u32`:`timestamp`]
* [`byte`:`message_flags`] * [`byte`:`must_be_one`]
* [`byte`:`channel_flags`] * [`byte`:`channel_flags`]
* [`u16`:`cltv_expiry_delta`] * [`u16`:`cltv_expiry_delta`]
* [`u64`:`htlc_minimum_msat`] * [`u64`:`htlc_minimum_msat`]
@ -425,13 +425,6 @@ individual bits:
| 0 | `direction` | Direction this update refers to. | | 0 | `direction` | Direction this update refers to. |
| 1 | `disable` | Disable the channel. | | 1 | `disable` | Disable the channel. |
The `message_flags` bitfield is used to indicate the presence of optional
fields in the `channel_update` message:
| Bit Position | Name | Field |
| ------------- | ------------------------- | -------------------------------- |
| 0 | `option_channel_htlc_max` | `htlc_maximum_msat` |
The `node_id` for the signature verification is taken from the corresponding The `node_id` for the signature verification is taken from the corresponding
`channel_announcement`: `node_id_1` if the least-significant bit of flags is 0 `channel_announcement`: `node_id_1` if the least-significant bit of flags is 0
or `node_id_2` otherwise. or `node_id_2` otherwise.
@ -456,12 +449,12 @@ The origin node:
- MUST set the `direction` bit of `channel_flags` to 0. - MUST set the `direction` bit of `channel_flags` to 0.
- otherwise: - otherwise:
- MUST set the `direction` bit of `channel_flags` to 1. - MUST set the `direction` bit of `channel_flags` to 1.
- MUST set the `option_channel_htlc_max` bit of `message_flags` to 1. - MUST set `must_be_one` to 1.
- MUST set `htlc_maximum_msat` to the maximum value it will send through this channel for a single HTLC. - MUST set `htlc_maximum_msat` to the maximum value it will send through this channel for a single HTLC.
- MUST set this to less than or equal to the channel capacity. - MUST set this to less than or equal to the channel capacity.
- MUST set this to less than or equal to `max_htlc_value_in_flight_msat` - MUST set this to less than or equal to `max_htlc_value_in_flight_msat`
it received from the peer. it received from the peer.
- MUST set bits in `channel_flags` and `message_flags `that are not assigned a meaning to 0. - MUST set bits in `channel_flags`that are not assigned a meaning to 0.
- MAY create and send a `channel_update` with the `disable` bit set to 1, to - MAY create and send a `channel_update` with the `disable` bit set to 1, to
signal a channel's temporary unavailability (e.g. due to a loss of signal a channel's temporary unavailability (e.g. due to a loss of
connectivity) OR permanent unavailability (e.g. prior to an on-chain connectivity) OR permanent unavailability (e.g. prior to an on-chain
@ -545,6 +538,10 @@ the channel when the peer reestablishes contact. Because gossip
messages are batched and replace previous ones, the result may be a messages are batched and replace previous ones, the result may be a
single seemingly-redundant update. single seemingly-redundant update.
The `must_be_one` field was previously used for message flags, and only
the lower bit was defined. It's now a constant value, and ignored by
receivers.
## Query Messages ## Query Messages
Negotiating the `gossip_queries` option via `init` enables a number Negotiating the `gossip_queries` option via `init` enables a number