input: remove duplicate commit weight constant
This commit is contained in:
5 files changed
+12
-18
No files matched your search
+2
-2
@@ -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
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user