mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
Doc: update to BOLT which assumes option_var_onion_optin.
We have assumed this for a long time, so nothing changes. Confusingly, this BOLT commit also cleaned up one reamining `option_anchors_zero_fee_htlc_tx`. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
7f2aedc76f
commit
65ef909bd3
2
Makefile
2
Makefile
@ -26,7 +26,7 @@ CCANDIR := ccan
|
||||
|
||||
# Where we keep the BOLT RFCs
|
||||
BOLTDIR := ../bolts/
|
||||
DEFAULT_BOLTVERSION := c48b4e3b275f628bfa267f6bcd2e00fa04d52882
|
||||
DEFAULT_BOLTVERSION := e042c615efb5139a0bfdca0c6391c3c13df70418
|
||||
# Can be overridden on cmdline.
|
||||
BOLTVERSION := $(DEFAULT_BOLTVERSION)
|
||||
|
||||
|
@ -25,8 +25,7 @@ struct channel_type *channel_type_none_obsolete(const tal_t *ctx)
|
||||
*
|
||||
* The currently defined basic types are:
|
||||
* - `option_static_remotekey` (bit 12)
|
||||
* - `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` (bits 22
|
||||
* and 12)
|
||||
* - `option_anchors` and `option_static_remotekey` (bits 22 and 12)
|
||||
*
|
||||
* Each basic type has the following variations allowed:
|
||||
*/
|
||||
@ -82,8 +81,8 @@ struct channel_type *default_channel_type(const tal_t *ctx,
|
||||
* - if `channel_type` was present in both `open_channel` and `accept_channel`:
|
||||
* - This is the `channel_type` (they must be equal, required above)
|
||||
* - otherwise:
|
||||
* - if `option_anchors_zero_fee_htlc_tx` was negotiated:
|
||||
* - the `channel_type` is `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` (bits 22 and 12)
|
||||
* - if `option_anchors` was negotiated:
|
||||
* - the `channel_type` is `option_anchors` and `option_static_remotekey` (bits 22 and 12)
|
||||
* - otherwise:
|
||||
* - the `channel_type` is `option_static_remotekey` (bit 12)
|
||||
*/
|
||||
|
@ -159,19 +159,10 @@ static const struct dependency feature_deps[] = {
|
||||
*...
|
||||
* `gossip_queries_ex` | ... | ... | `gossip_queries` |
|
||||
*...
|
||||
* `payment_secret` | ... | ... | `var_onion_optin` |
|
||||
*...
|
||||
* `basic_mpp` | ... | ... | `payment_secret` |
|
||||
*/
|
||||
{ OPT_GOSSIP_QUERIES_EX, OPT_GOSSIP_QUERIES },
|
||||
{ OPT_PAYMENT_SECRET, OPT_VAR_ONION },
|
||||
{ OPT_BASIC_MPP, OPT_PAYMENT_SECRET },
|
||||
/* BOLT #9:
|
||||
* Name | Description | Context | Dependencies |
|
||||
* ...
|
||||
* `option_route_blinding` | ... | ... | `var_onion_optin`
|
||||
*/
|
||||
{ OPT_ROUTE_BLINDING, OPT_VAR_ONION },
|
||||
};
|
||||
|
||||
static void trim_features(u8 **features)
|
||||
|
@ -106,7 +106,7 @@ struct feature_set *feature_set_dup(const tal_t *ctx,
|
||||
* | 3 | `initial_routing_sync` |... I ...
|
||||
* | 4/5 | `option_upfront_shutdown_script` |... IN ...
|
||||
* | 6/7 | `gossip_queries` |... IN ...
|
||||
* | 8/9 | `var_onion_optin` |... IN9 ...
|
||||
* | 8/9 | `var_onion_optin` |... ASSUMED ...
|
||||
* | 10/11 | `gossip_queries_ex` |... IN ...
|
||||
* | 12/13 | `option_static_remotekey` |... ASSUMED ...
|
||||
* | 14/15 | `payment_secret` |... IN9 ...
|
||||
|
@ -20,7 +20,7 @@ static inline struct amount_sat htlc_timeout_fee(u32 feerate_per_kw,
|
||||
/* BOLT #3:
|
||||
*
|
||||
* The fee for an HTLC-timeout transaction:
|
||||
* - If `option_anchors_zero_fee_htlc_tx` applies:
|
||||
* - If `option_anchors` applies:
|
||||
* 1. MUST be 0.
|
||||
* - Otherwise, MUST be calculated to match:
|
||||
* 1. Multiply `feerate_per_kw` by 663 and divide by 1000 (rounding down).
|
||||
@ -46,7 +46,7 @@ static inline struct amount_sat htlc_success_fee(u32 feerate_per_kw,
|
||||
/* BOLT #3:
|
||||
*
|
||||
* The fee for an HTLC-success transaction:
|
||||
* - If `option_anchors_zero_fee_htlc_tx` applies:
|
||||
* - If `option_anchors` applies:
|
||||
* 1. MUST be 0.
|
||||
* - Otherwise, MUST be calculated to match:
|
||||
* 1. Multiply `feerate_per_kw` by 703 and divide by 1000 (rounding down).
|
||||
|
@ -418,14 +418,14 @@ static bool grind_htlc_tx_fee(struct amount_sat *fee,
|
||||
/* BOLT #3:
|
||||
*
|
||||
* The fee for an HTLC-timeout transaction:
|
||||
* - If `option_anchors_zero_fee_htlc_tx` applies:
|
||||
* - If `option_anchors` applies:
|
||||
* 1. MUST be 0.
|
||||
* - Otherwise, MUST be calculated to match:
|
||||
* 1. Multiply `feerate_per_kw` by 663
|
||||
* and divide by 1000 (rounding down).
|
||||
*
|
||||
* The fee for an HTLC-success transaction:
|
||||
* - If `option_anchors_zero_fee_htlc_tx` applies:
|
||||
* - If `option_anchors` applies:
|
||||
* 1. MUST be 0.
|
||||
* - Otherwise, MUST be calculated to match:
|
||||
* 1. Multiply `feerate_per_kw` by 703
|
||||
@ -471,7 +471,7 @@ static bool set_htlc_timeout_fee(struct bitcoin_tx *tx,
|
||||
/* BOLT #3:
|
||||
*
|
||||
* The fee for an HTLC-timeout transaction:
|
||||
* - If `option_anchors_zero_fee_htlc_tx` applies:
|
||||
* - If `option_anchors` applies:
|
||||
* 1. MUST be 0.
|
||||
* - Otherwise, MUST be calculated to match:
|
||||
* 1. Multiply `feerate_per_kw` by 663 and divide by 1000 (rounding down).
|
||||
@ -546,7 +546,7 @@ static struct amount_sat get_htlc_success_fee(struct tracked_output *out)
|
||||
/* BOLT #3:
|
||||
*
|
||||
* The fee for an HTLC-success transaction:
|
||||
* - If `option_anchors_zero_fee_htlc_tx` applies:
|
||||
* - If `option_anchors` applies:
|
||||
* 1. MUST be 0.
|
||||
* - Otherwise, MUST be calculated to match:
|
||||
* 1. Multiply `feerate_per_kw` by 703 and divide by 1000 (rounding down).
|
||||
|
Loading…
Reference in New Issue
Block a user