multi: deprecate batchwindowduration config option

This commit is contained in:
yyforyongyu
2024-01-31 14:06:47 +08:00
parent c03509397f
commit 465332f409
8 changed files with 9 additions and 32 deletions

View File

@@ -1,17 +1,10 @@
package sweep
import (
"time"
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
)
var (
// DefaultBatchWindowDuration specifies duration of the sweep batch
// window. The sweep is held back during the batch window to allow more
// inputs to be added and thereby lower the fee per input.
DefaultBatchWindowDuration = 30 * time.Second
// DefaultMaxFeeRate is the default maximum fee rate allowed within the
// UtxoSweeper. The current value is equivalent to a fee rate of 1,000
// sat/vbyte.

View File

@@ -5,7 +5,6 @@ import (
"fmt"
"sync"
"sync/atomic"
"time"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg/chainhash"
@@ -318,12 +317,6 @@ type UtxoSweeperConfig struct {
// Wallet contains the wallet functions that sweeper requires.
Wallet Wallet
// TickerDuration is used to create a channel that will be sent on when
// a certain time window has passed. During this time window, new
// inputs can still be added to the sweep tx that is about to be
// generated.
TickerDuration time.Duration
// Notifier is an instance of a chain notifier we'll use to watch for
// certain on-chain events.
Notifier chainntnfs.ChainNotifier

View File

@@ -138,11 +138,10 @@ func createSweeperTestContext(t *testing.T) *sweeperTestContext {
}
ctx.sweeper = New(&UtxoSweeperConfig{
Notifier: notifier,
Wallet: backend,
TickerDuration: 100 * time.Millisecond,
Store: store,
Signer: &lnmock.DummySigner{},
Notifier: notifier,
Wallet: backend,
Store: store,
Signer: &lnmock.DummySigner{},
GenSweepScript: func() ([]byte, error) {
script := make([]byte, input.P2WPKHSize)
script[0] = 0