sweep: pass dustLimit to CreateSweepTx

This commit is contained in:
Johan T. Halseth committed 2020-11-20 13:06:53 +01:00
1 parent 3d209059c1
commit aa8fa9d0cf
6 files changed
+30 -21

No files matched your search

+8 -4
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),