input: remove duplicate commit weight constant

This commit is contained in:
Johan T. Halseth committed 2020-01-06 12:08:25 +01:00
1 parent a56ed72bd7
commit 3711597fef
5 files changed
+12 -18

No files matched your search

+2 -2
View File
@@ -3450,7 +3450,7 @@ func (lc *LightningChannel) computeView(view *htlcView, remoteChain bool,
continue
}
totalHtlcWeight += input.HtlcWeight
totalHtlcWeight += input.HTLCWeight
}
for _, htlc := range filteredHTLCView.theirUpdates {
if htlcIsDust(!remoteChain, !remoteChain, feePerKw,
@@ -3458,7 +3458,7 @@ func (lc *LightningChannel) computeView(view *htlcView, remoteChain bool,
continue
}
totalHtlcWeight += input.HtlcWeight
totalHtlcWeight += input.HTLCWeight
}
totalCommitWeight := input.CommitWeight + totalHtlcWeight
+1 -1
View File
@@ -600,7 +600,7 @@ func TestForceClose(t *testing.T) {
// Factoring in the fee rate, Alice's amount should properly reflect
// that we've added two additional HTLC to the commitment transaction.
totalCommitWeight := input.CommitWeight + (input.HtlcWeight * 2)
totalCommitWeight := int64(input.CommitWeight + (input.HTLCWeight * 2))
feePerKw := chainfee.SatPerKWeight(
aliceChannel.channelState.LocalCommitment.FeePerKw,
)
+1 -1
View File
@@ -287,7 +287,7 @@ func (cb *CommitmentBuilder) createUnsignedCommitmentTx(ourBalance,
// on its total weight. Once we have the total weight, we'll multiply
// by the current fee-per-kw, then divide by 1000 to get the proper
// fee.
totalCommitWeight := input.CommitWeight + (input.HtlcWeight * numHTLCs)
totalCommitWeight := input.CommitWeight + (input.HTLCWeight * numHTLCs)
// With the weight known, we can now calculate the commitment fee,
// ensuring that we account for any dust outputs trimmed above.