From 91bb95991ecf2a3bd99d1c26f8f0a857cf731662 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Sun, 26 Nov 2017 13:34:25 -0600 Subject: [PATCH] lnwallet: make 1% reservation computation clearer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding 99 here didn’t really do anything but obfuscate when we were trying to compute. We’re just using internet division to calculate 1% of the channel capacity amount. This is the amount that the remote party must remain above at all times. --- lnwallet/reservation.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lnwallet/reservation.go b/lnwallet/reservation.go index 4b6d858c1..87b777897 100644 --- a/lnwallet/reservation.go +++ b/lnwallet/reservation.go @@ -288,9 +288,10 @@ func (r *ChannelReservation) RemoteChanConstraints() (btcutil.Amount, lnwire.Mil // TODO(roasbeef): move csv delay calculation into func? - // By default, we'll require them to maintain at least 1% of thee total - // channel capacity at all times. - chanReserve := (chanCapacity + 99) / 100 + // By default, we'll require them to maintain at least 1% of the total + // channel capacity at all times. This is the absolute amount the + // settled balance of the remote party must be above at *all* times. + chanReserve := (chanCapacity) / 100 // We'll allow them to fully utilize the full bandwidth of the channel, // minus our required reserve.