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:
eugene
2021-09-23 15:40:37 -04:00
parent 3385d38414
commit fdcd726f9a
27 changed files with 330 additions and 154 deletions

View File

@@ -1227,8 +1227,7 @@ func (r *rpcServer) SendCoins(ctx context.Context,
// pay to the change address created above if we needed to
// reserve any value, the rest will go to targetAddr.
sweepTxPkg, err := sweep.CraftSweepAllTx(
feePerKw, lnwallet.DefaultDustLimit(),
uint32(bestHeight), nil, targetAddr, wallet,
feePerKw, uint32(bestHeight), nil, targetAddr, wallet,
wallet, wallet.WalletController,
r.server.cc.FeeEstimator, r.server.cc.Signer,
minConfs,
@@ -1280,9 +1279,9 @@ func (r *rpcServer) SendCoins(ctx context.Context,
}
sweepTxPkg, err = sweep.CraftSweepAllTx(
feePerKw, lnwallet.DefaultDustLimit(),
uint32(bestHeight), outputs, targetAddr, wallet,
wallet, wallet.WalletController,
feePerKw, uint32(bestHeight), outputs,
targetAddr, wallet, wallet,
wallet.WalletController,
r.server.cc.FeeEstimator, r.server.cc.Signer,
minConfs,
)