mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
Spec: Update to latest BOLT, include our first global feature definition.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
6310a183af
commit
6349222ea2
2
Makefile
2
Makefile
@ -15,7 +15,7 @@ CCANDIR := ccan
|
|||||||
|
|
||||||
# Where we keep the BOLT RFCs
|
# Where we keep the BOLT RFCs
|
||||||
BOLTDIR := ../lightning-rfc/
|
BOLTDIR := ../lightning-rfc/
|
||||||
BOLTVERSION := 8b2cf0054660bece9e1004f42a500c6a1a77efd3
|
BOLTVERSION := 8555709811e6b2326f80dc479021b161e850bf03
|
||||||
|
|
||||||
-include config.vars
|
-include config.vars
|
||||||
|
|
||||||
|
@ -2231,6 +2231,11 @@ static void peer_reconnect(struct peer *peer,
|
|||||||
* - MUST set `next_revocation_number` to the commitment number
|
* - MUST set `next_revocation_number` to the commitment number
|
||||||
* of the next `revoke_and_ack` message it expects to receive.
|
* of the next `revoke_and_ack` message it expects to receive.
|
||||||
* - if it supports `option_data_loss_protect`:
|
* - if it supports `option_data_loss_protect`:
|
||||||
|
* - MUST set `my_current_per_commitment_point` to its commitment
|
||||||
|
* point for the last signed commitment it received from its
|
||||||
|
* channel peer (i.e. the commitment_point corresponding to the
|
||||||
|
* commitment transaction the sender would use to unilaterally
|
||||||
|
* close).
|
||||||
* - if `next_revocation_number` equals 0:
|
* - if `next_revocation_number` equals 0:
|
||||||
* - MUST set `your_last_per_commitment_secret` to all zeroes
|
* - MUST set `your_last_per_commitment_secret` to all zeroes
|
||||||
* - otherwise:
|
* - otherwise:
|
||||||
|
@ -36,4 +36,13 @@ bool global_feature_negotiated(const u8 *gfeatures, size_t f);
|
|||||||
#define LOCAL_UPFRONT_SHUTDOWN_SCRIPT 4
|
#define LOCAL_UPFRONT_SHUTDOWN_SCRIPT 4
|
||||||
#define LOCAL_GOSSIP_QUERIES 6
|
#define LOCAL_GOSSIP_QUERIES 6
|
||||||
|
|
||||||
|
/* BOLT #9:
|
||||||
|
*
|
||||||
|
* ## Assigned `globalfeatures` flags
|
||||||
|
*...
|
||||||
|
* | Bits | Name | ...
|
||||||
|
* | 8/9 | `var_onion_optin` | ...
|
||||||
|
*/
|
||||||
|
#define GLOBAL_VAR_ONION 8
|
||||||
|
|
||||||
#endif /* LIGHTNING_COMMON_FEATURES_H */
|
#endif /* LIGHTNING_COMMON_FEATURES_H */
|
||||||
|
@ -344,6 +344,7 @@ void peer_start_channeld(struct channel *channel,
|
|||||||
/* BOLT #2:
|
/* BOLT #2:
|
||||||
*
|
*
|
||||||
* - if it supports `option_data_loss_protect`:
|
* - if it supports `option_data_loss_protect`:
|
||||||
|
*...
|
||||||
* - if `next_revocation_number` equals 0:
|
* - if `next_revocation_number` equals 0:
|
||||||
* - MUST set `your_last_per_commitment_secret` to all zeroes
|
* - MUST set `your_last_per_commitment_secret` to all zeroes
|
||||||
* - otherwise:
|
* - otherwise:
|
||||||
|
@ -247,6 +247,7 @@ void peer_start_closingd(struct channel *channel,
|
|||||||
/* BOLT #2:
|
/* BOLT #2:
|
||||||
*
|
*
|
||||||
* - if it supports `option_data_loss_protect`:
|
* - if it supports `option_data_loss_protect`:
|
||||||
|
*...
|
||||||
* - if `next_revocation_number` equals 0:
|
* - if `next_revocation_number` equals 0:
|
||||||
* - MUST set `your_last_per_commitment_secret` to all zeroes
|
* - MUST set `your_last_per_commitment_secret` to all zeroes
|
||||||
* - otherwise:
|
* - otherwise:
|
||||||
|
@ -309,7 +309,7 @@ static void handle_localpay(struct htlc_in *hin,
|
|||||||
*
|
*
|
||||||
* - if the `cltv_expiry` value is unreasonably near the present:
|
* - if the `cltv_expiry` value is unreasonably near the present:
|
||||||
* - MUST fail the HTLC.
|
* - MUST fail the HTLC.
|
||||||
* - MUST return a `final_expiry_too_soon` error.
|
* - MUST return an `incorrect_or_unknown_payment_details` error.
|
||||||
*/
|
*/
|
||||||
if (get_block_height(ld->topology) + ld->config.cltv_final
|
if (get_block_height(ld->topology) + ld->config.cltv_final
|
||||||
> cltv_expiry) {
|
> cltv_expiry) {
|
||||||
@ -318,6 +318,7 @@ static void handle_localpay(struct htlc_in *hin,
|
|||||||
cltv_expiry,
|
cltv_expiry,
|
||||||
get_block_height(ld->topology),
|
get_block_height(ld->topology),
|
||||||
ld->config.cltv_final);
|
ld->config.cltv_final);
|
||||||
|
/* FIXME! */
|
||||||
failcode = WIRE_FINAL_EXPIRY_TOO_SOON;
|
failcode = WIRE_FINAL_EXPIRY_TOO_SOON;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user