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.
This commit is contained in:
Olaoluwa Osuntokun 2017-05-16 18:52:33 -07:00
parent 392f6b5d8a
commit 48850d31d6
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2

View File

@ -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