From cd6d0ccde7ba9bd2d0a947e4dd2d965ea1139185 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 17 Jul 2019 07:18:14 +0930 Subject: [PATCH] openingd: round *down* for reserve amount. That's what other implementations do, so it simplifies the test vectors. Signed-off-by: Rusty Russell --- openingd/openingd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openingd/openingd.c b/openingd/openingd.c index 27d629500..a43268d3f 100644 --- a/openingd/openingd.c +++ b/openingd/openingd.c @@ -312,11 +312,11 @@ static bool check_config_bounds(struct state *state, return true; } -/* We always set channel_reserve_satoshis to 1%, rounded up. */ +/* We always set channel_reserve_satoshis to 1%, rounded down. */ static void set_reserve(struct state *state) { state->localconf.channel_reserve.satoshis /* Raw: rounding. */ - = (state->funding.satoshis + 99) / 100; /* Raw: rounding. */ + = state->funding.satoshis / 100; /* Raw: rounding. */ /* BOLT #2: *