diff --git a/server.go b/server.go index c3378839..31e96c52 100644 --- a/server.go +++ b/server.go @@ -607,7 +607,7 @@ func newServer(listenAddrs []net.Addr, chanDB *channeldb.DB, cc *chainControl, } s.sweeper = sweep.New(&sweep.UtxoSweeperConfig{ - Estimator: cc.feeEstimator, + FeeEstimator: cc.feeEstimator, GenSweepScript: func() ([]byte, error) { return newSweepPkScript(cc.wallet) }, diff --git a/sweep/sweeper.go b/sweep/sweeper.go index 3829d27e..2c87ba71 100644 --- a/sweep/sweeper.go +++ b/sweep/sweeper.go @@ -85,10 +85,10 @@ type UtxoSweeperConfig struct { // funds can be swept. GenSweepScript func() ([]byte, error) - // Estimator is used when crafting sweep transactions to estimate the - // necessary fee relative to the expected size of the sweep + // FeeEstimator is used when crafting sweep transactions to estimate + // the necessary fee relative to the expected size of the sweep // transaction. - Estimator lnwallet.FeeEstimator + FeeEstimator lnwallet.FeeEstimator // PublishTransaction facilitates the process of broadcasting a signed // transaction to the appropriate network. @@ -198,7 +198,7 @@ func (s *UtxoSweeper) Start() error { // Retrieve relay fee for dust limit calculation. Assume that this will // not change from here on. - s.relayFeePerKW = s.cfg.Estimator.RelayFeePerKW() + s.relayFeePerKW = s.cfg.FeeEstimator.RelayFeePerKW() // Register for block epochs to retry sweeping every block. bestHash, bestHeight, err := s.cfg.ChainIO.GetBestBlock() @@ -407,7 +407,7 @@ func (s *UtxoSweeper) collector(blockEpochs <-chan *chainntnfs.BlockEpoch, // Retrieve fee estimate for input filtering and final // tx fee calculation. - satPerKW, err := s.cfg.Estimator.EstimateFeePerKW( + satPerKW, err := s.cfg.FeeEstimator.EstimateFeePerKW( s.cfg.SweepTxConfTarget, ) if err != nil { @@ -465,7 +465,7 @@ func (s *UtxoSweeper) scheduleSweep(currentHeight int32) error { // Retrieve fee estimate for input filtering and final tx fee // calculation. - satPerKW, err := s.cfg.Estimator.EstimateFeePerKW( + satPerKW, err := s.cfg.FeeEstimator.EstimateFeePerKW( s.cfg.SweepTxConfTarget, ) if err != nil { @@ -753,7 +753,7 @@ func (s *UtxoSweeper) waitForSpend(outpoint wire.OutPoint, func (s *UtxoSweeper) CreateSweepTx(inputs []Input, confTarget uint32, currentBlockHeight uint32) (*wire.MsgTx, error) { - feePerKw, err := s.cfg.Estimator.EstimateFeePerKW(confTarget) + feePerKw, err := s.cfg.FeeEstimator.EstimateFeePerKW(confTarget) if err != nil { return nil, err } diff --git a/sweep/sweeper_test.go b/sweep/sweeper_test.go index 6a59f5dc..d2204e1d 100644 --- a/sweep/sweeper_test.go +++ b/sweep/sweeper_test.go @@ -135,7 +135,7 @@ func createSweeperTestContext(t *testing.T) *sweeperTestContext { outputScriptCount++ return script, nil }, - Estimator: estimator, + FeeEstimator: estimator, MaxInputsPerTx: testMaxInputsPerTx, MaxSweepAttempts: testMaxSweepAttempts, NextAttemptDeltaFunc: func(attempts int) int32 {