From 370e4ce98dc8cacbc2de657fda216f2d9cda7d37 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Tue, 19 Mar 2024 03:53:43 +0800 Subject: [PATCH] lnd+sweep: remove unused config `MaxSweepAttempts` --- server.go | 23 +++++++++++------------ sweep/sweeper.go | 10 ---------- sweep/sweeper_test.go | 11 +++++------ 3 files changed, 16 insertions(+), 28 deletions(-) diff --git a/server.go b/server.go index e7d3c16b9..638d3730b 100644 --- a/server.go +++ b/server.go @@ -1076,18 +1076,17 @@ func newServer(cfg *Config, listenAddrs []net.Addr, }) s.sweeper = sweep.New(&sweep.UtxoSweeperConfig{ - FeeEstimator: cc.FeeEstimator, - GenSweepScript: newSweepPkScriptGen(cc.Wallet), - Signer: cc.Wallet.Cfg.Signer, - Wallet: newSweeperWallet(cc.Wallet), - Mempool: cc.MempoolNotifier, - Notifier: cc.ChainNotifier, - Store: sweeperStore, - MaxInputsPerTx: sweep.DefaultMaxInputsPerTx, - MaxSweepAttempts: sweep.DefaultMaxSweepAttempts, - MaxFeeRate: cfg.Sweeper.MaxFeeRate, - Aggregator: aggregator, - Publisher: s.txPublisher, + FeeEstimator: cc.FeeEstimator, + GenSweepScript: newSweepPkScriptGen(cc.Wallet), + Signer: cc.Wallet.Cfg.Signer, + Wallet: newSweeperWallet(cc.Wallet), + Mempool: cc.MempoolNotifier, + Notifier: cc.ChainNotifier, + Store: sweeperStore, + MaxInputsPerTx: sweep.DefaultMaxInputsPerTx, + MaxFeeRate: cfg.Sweeper.MaxFeeRate, + Aggregator: aggregator, + Publisher: s.txPublisher, }) s.utxoNursery = contractcourt.NewUtxoNursery(&contractcourt.NurseryConfig{ diff --git a/sweep/sweeper.go b/sweep/sweeper.go index 0e39e27b8..85d9ad5e8 100644 --- a/sweep/sweeper.go +++ b/sweep/sweeper.go @@ -36,11 +36,6 @@ var ( // it is/has already been stopped. ErrSweeperShuttingDown = errors.New("utxo sweeper shutting down") - // DefaultMaxSweepAttempts specifies the default maximum number of times - // an input is included in a publish attempt before giving up and - // returning an error to the caller. - DefaultMaxSweepAttempts = 10 - // DefaultDeadlineDelta defines a default deadline delta (1 week) to be // used when sweeping inputs with no deadline pressure. // @@ -361,11 +356,6 @@ type UtxoSweeperConfig struct { // created and published. MaxInputsPerTx uint32 - // MaxSweepAttempts specifies the maximum number of times an input is - // included in a publish attempt before giving up and returning an error - // to the caller. - MaxSweepAttempts int - // MaxFeeRate is the maximum fee rate allowed within the UtxoSweeper. MaxFeeRate chainfee.SatPerVByte diff --git a/sweep/sweeper_test.go b/sweep/sweeper_test.go index 800e0900c..3921cf7d0 100644 --- a/sweep/sweeper_test.go +++ b/sweep/sweeper_test.go @@ -159,12 +159,11 @@ func createSweeperTestContext(t *testing.T) *sweeperTestContext { script[1] = 20 return script, nil }, - FeeEstimator: estimator, - MaxInputsPerTx: testMaxInputsPerTx, - MaxSweepAttempts: testMaxSweepAttempts, - MaxFeeRate: DefaultMaxFeeRate, - Aggregator: aggregator, - Publisher: mockBumper, + FeeEstimator: estimator, + MaxInputsPerTx: testMaxInputsPerTx, + MaxFeeRate: DefaultMaxFeeRate, + Aggregator: aggregator, + Publisher: mockBumper, }) ctx.sweeper.Start()