diff --git a/server.go b/server.go index cc7f95d09..7c707cead 100644 --- a/server.go +++ b/server.go @@ -1068,19 +1068,18 @@ 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), - TickerDuration: cfg.Sweeper.BatchWindowDuration, - Mempool: cc.MempoolNotifier, - Notifier: cc.ChainNotifier, - Store: sweeperStore, - MaxInputsPerTx: sweep.DefaultMaxInputsPerTx, - MaxSweepAttempts: sweep.DefaultMaxSweepAttempts, - NextAttemptDeltaFunc: sweep.DefaultNextAttemptDeltaFunc, - MaxFeeRate: cfg.Sweeper.MaxFeeRate, - Aggregator: aggregator, + FeeEstimator: cc.FeeEstimator, + GenSweepScript: newSweepPkScriptGen(cc.Wallet), + Signer: cc.Wallet.Cfg.Signer, + Wallet: newSweeperWallet(cc.Wallet), + TickerDuration: cfg.Sweeper.BatchWindowDuration, + Mempool: cc.MempoolNotifier, + Notifier: cc.ChainNotifier, + Store: sweeperStore, + MaxInputsPerTx: sweep.DefaultMaxInputsPerTx, + MaxSweepAttempts: sweep.DefaultMaxSweepAttempts, + MaxFeeRate: cfg.Sweeper.MaxFeeRate, + Aggregator: aggregator, }) s.utxoNursery = contractcourt.NewUtxoNursery(&contractcourt.NurseryConfig{ diff --git a/sweep/sweeper.go b/sweep/sweeper.go index 77fba4f5c..034dd46e8 100644 --- a/sweep/sweeper.go +++ b/sweep/sweeper.go @@ -359,12 +359,7 @@ type UtxoSweeperConfig struct { // to the caller. MaxSweepAttempts int - // NextAttemptDeltaFunc returns given the number of already attempted - // sweeps, how many blocks to wait before retrying to sweep. - NextAttemptDeltaFunc func(int) int32 - - // MaxFeeRate is the maximum fee rate allowed within the - // UtxoSweeper. + // MaxFeeRate is the maximum fee rate allowed within the UtxoSweeper. MaxFeeRate chainfee.SatPerVByte // Aggregator is used to group inputs into clusters based on its @@ -1335,14 +1330,6 @@ func (s *UtxoSweeper) CreateSweepTx(inputs []input.Input, return tx, err } -// DefaultNextAttemptDeltaFunc is the default calculation for next sweep attempt -// scheduling. It implements exponential back-off with some randomness. This is -// to prevent a stuck tx (for example because fee is too low and can't be bumped -// in btcd) from blocking all other retried inputs in the same tx. -func DefaultNextAttemptDeltaFunc(attempts int) int32 { - return 1 + rand.Int31n(1<