From f495363bc4c4f72c5a740901db4e283828aafa13 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 14 Aug 2020 11:00:42 +0930 Subject: [PATCH] openingd: add bolt quote about reserve calculation. Suggested-by: @niftynei Signed-off-by: Rusty Russell --- openingd/openingd.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openingd/openingd.c b/openingd/openingd.c index f139e6f56..309285ed9 100644 --- a/openingd/openingd.c +++ b/openingd/openingd.c @@ -244,8 +244,13 @@ static bool check_config_bounds(struct state *state, return false; } - /* If they're opener, they must pay for anchor outputs, so include - * that in "reserve". */ + /* BOLT-a12da24dd0102c170365124782b46d9710950ac1 #2: + * - if `option_anchor_outputs` applies to this commitment + * transaction and the sending node is the funder: + * - MUST be able to additionally pay for `to_local_anchor` and + * `to_remote_anchor` above its reserve. + */ + /* (We simply include in "reserve" here if they opened). */ if (state->option_anchor_outputs && !am_opener && !amount_sat_add(&reserve, reserve, AMOUNT_SAT(660))) {