wallet: channel test fee fix for added HTLC
This commit fixes the TestChannelBalanceDustLimit unit test in channel_test.go. The unit test does not account for the fees required by adding an HTLC. As a result, Alice's balance according to her local and remote commitment chains drops below 0 at certain points. By using the correct fee, this is avoided.
This commit is contained in:
parent
cc221b1548
commit
aa6395874d
@ -1289,10 +1289,10 @@ func TestChannelBalanceDustLimit(t *testing.T) {
|
|||||||
|
|
||||||
// This amount should leave an amount larger than Alice's dust limit
|
// This amount should leave an amount larger than Alice's dust limit
|
||||||
// once fees have been subtracted, but smaller than Bob's dust limit.
|
// once fees have been subtracted, but smaller than Bob's dust limit.
|
||||||
defaultFee := calcStaticFee(0)
|
// We account in fees for the HTLC we will be adding.
|
||||||
dustLimit := aliceChannel.channelState.LocalChanCfg.DustLimit
|
defaultFee := calcStaticFee(1)
|
||||||
aliceBalance := aliceChannel.channelState.LocalBalance.ToSatoshis()
|
aliceBalance := aliceChannel.channelState.LocalBalance.ToSatoshis()
|
||||||
htlcSat := aliceBalance - (defaultFee + dustLimit + 100)
|
htlcSat := aliceBalance - defaultFee
|
||||||
htlcSat += htlcSuccessFee(aliceChannel.channelState.FeePerKw)
|
htlcSat += htlcSuccessFee(aliceChannel.channelState.FeePerKw)
|
||||||
|
|
||||||
htlcAmount := lnwire.NewMSatFromSatoshis(htlcSat)
|
htlcAmount := lnwire.NewMSatFromSatoshis(htlcSat)
|
||||||
|
Loading…
Reference in New Issue
Block a user