multi: replace DefaultDustLimit with script-specific DustLimitForSize
This commit updates call-sites to use the proper dust limits for various script types. This also updates the default dust limit used in the funding flow to be 354 satoshis instead of 573 satoshis.
This commit is contained in:
27 files changed
+330
-154
No files matched your search
@@ -16,6 +16,7 @@ import (
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/lightningnetwork/lnd/chainreg"
|
||||
"github.com/lightningnetwork/lnd/funding"
|
||||
"github.com/lightningnetwork/lnd/input"
|
||||
"github.com/lightningnetwork/lnd/lncfg"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/routerrpc"
|
||||
@@ -417,12 +418,15 @@ func testListChannels(net *lntest.NetworkHarness, t *harnessTest) {
|
||||
// Check the returned response is correct.
|
||||
aliceChannel := resp.Channels[0]
|
||||
|
||||
// Calculate the dust limit we'll use for the test.
|
||||
dustLimit := lnwallet.DustLimitForSize(input.UnknownWitnessSize)
|
||||
|
||||
// defaultConstraints is a ChannelConstraints with default values. It is
|
||||
// used to test against Alice's local channel constraints.
|
||||
defaultConstraints := &lnrpc.ChannelConstraints{
|
||||
CsvDelay: 4,
|
||||
ChanReserveSat: 1000,
|
||||
DustLimitSat: uint64(lnwallet.DefaultDustLimit()),
|
||||
DustLimitSat: uint64(dustLimit),
|
||||
MaxPendingAmtMsat: 99000000,
|
||||
MinHtlcMsat: 1,
|
||||
MaxAcceptedHtlcs: bobRemoteMaxHtlcs,
|
||||
@@ -438,7 +442,7 @@ func testListChannels(net *lntest.NetworkHarness, t *harnessTest) {
|
||||
customizedConstraints := &lnrpc.ChannelConstraints{
|
||||
CsvDelay: 4,
|
||||
ChanReserveSat: 1000,
|
||||
DustLimitSat: uint64(lnwallet.DefaultDustLimit()),
|
||||
DustLimitSat: uint64(dustLimit),
|
||||
MaxPendingAmtMsat: 99000000,
|
||||
MinHtlcMsat: customizedMinHtlc,
|
||||
MaxAcceptedHtlcs: aliceRemoteMaxHtlcs,
|
||||
|
||||
Reference in new issue
Block a user