Skip to content

Commit

Permalink
doc: include recent BOLT recommendation on grace period.
Browse files Browse the repository at this point in the history
This includes the recommendation that we use 10 minute grace period,
so add quotes to where we use that.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Aug 27, 2022
1 parent d7a1d20 commit a86468d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lightningd/peer_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -2585,6 +2585,10 @@ static struct command_result *json_setchannelfee(struct command *cmd,
&base, cmd->ld->config.fee_base),
p_opt_def("ppm", param_number, &ppm,
cmd->ld->config.fee_per_satoshi),
/* BOLT #7:
* If it creates a new `channel_update` with updated channel parameters:
* - SHOULD keep accepting the previous channel parameters for 10 minutes
*/
p_opt_def("enforcedelay", param_number, &delaysecs, 600),
NULL))
return command_param_failed();
Expand Down
5 changes: 4 additions & 1 deletion lightningd/peer_htlcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,10 @@ static void forward_htlc(struct htlc_in *hin,
if (!check_fwd_amount(hin, amt_to_forward, hin->msat,
next->feerate_base,
next->feerate_ppm)) {
/* Are we in old-fee grace-period? */
/* BOLT #7:
* - If it creates a new `channel_update` with updated channel parameters:
* - SHOULD keep accepting the previous channel parameters for 10 minutes
*/
if (!time_before(time_now(), next->old_feerate_timeout)
|| !check_fwd_amount(hin, amt_to_forward, hin->msat,
next->old_feerate_base,
Expand Down

0 comments on commit a86468d

Please sign in to comment.