From 48850d31d6a719a98d8bb1d46efdf8493dc1463e Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Tue, 16 May 2017 18:52:33 -0700 Subject: [PATCH] lnwallet: simplify remote balance computation for single funder The remote balance in the case of a single funder workflow is simply what ever the pushSat amount is. The capacity - fundingAmt in this scenario would always be zero, so we simply just set it directly to pushSat. --- lnwallet/reservation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lnwallet/reservation.go b/lnwallet/reservation.go index 9968c3e0d..1727b95ae 100644 --- a/lnwallet/reservation.go +++ b/lnwallet/reservation.go @@ -174,7 +174,7 @@ func NewChannelReservation(capacity, fundingAmt btcutil.Amount, minFeeRate btcut // transaction. We also deduct our balance by the // amount pushed as part of the initial state. ourBalance = capacity - commitFee - pushSat - theirBalance = capacity - fundingAmt + pushSat + theirBalance = pushSat } else { // Otherwise, this is a dual funder workflow where both // slides split the amount funded and the commitment