sweep: pass dustLimit to CreateSweepTx

This commit is contained in:
Johan T. Halseth
2020-11-06 19:44:12 +01:00
parent 3d209059c1
commit aa8fa9d0cf
6 changed files with 30 additions and 21 deletions

View File

@@ -83,14 +83,18 @@ type txInputSet struct {
wallet Wallet
}
func dustLimit(relayFee chainfee.SatPerKWeight) btcutil.Amount {
return txrules.GetDustThreshold(
input.P2WPKHSize,
btcutil.Amount(relayFee.FeePerKVByte()),
)
}
// newTxInputSet constructs a new, empty input set.
func newTxInputSet(wallet Wallet, feePerKW,
relayFee chainfee.SatPerKWeight, maxInputs int) *txInputSet {
dustLimit := txrules.GetDustThreshold(
input.P2WPKHSize,
btcutil.Amount(relayFee.FeePerKVByte()),
)
dustLimit := dustLimit(relayFee)
state := txInputSetState{
weightEstimate: newWeightEstimator(feePerKW),