From 23cd2f40eb05e919a0c20a077d9af1a4f5047b95 Mon Sep 17 00:00:00 2001 From: Joost Jager Date: Mon, 14 Sep 2020 11:24:12 +0200 Subject: [PATCH] lnwallet: remove unused WebAPIEstimator field --- chainregistry.go | 1 - lnwallet/chainfee/estimator.go | 9 +-------- lnwallet/chainfee/estimator_test.go | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/chainregistry.go b/chainregistry.go index f5d4ac791..23a2f0f4e 100644 --- a/chainregistry.go +++ b/chainregistry.go @@ -257,7 +257,6 @@ func newChainControlFromConfig(cfg *Config, localDB, remoteDB *channeldb.DB, chainfee.SparseConfFeeSource{ URL: cfg.NeutrinoMode.FeeURL, }, - defaultBitcoinStaticFeePerKW, ) if err := estimator.Start(); err != nil { diff --git a/lnwallet/chainfee/estimator.go b/lnwallet/chainfee/estimator.go index 98c74f613..13a04d760 100644 --- a/lnwallet/chainfee/estimator.go +++ b/lnwallet/chainfee/estimator.go @@ -540,23 +540,16 @@ type WebAPIEstimator struct { feesMtx sync.Mutex feeByBlockTarget map[uint32]uint32 - // defaultFeePerKw is a fallback value that we'll use if we're unable - // to query the API for any reason. - defaultFeePerKw SatPerKWeight - quit chan struct{} wg sync.WaitGroup } // NewWebAPIEstimator creates a new WebAPIEstimator from a given URL and a // fallback default fee. The fees are updated whenever a new block is mined. -func NewWebAPIEstimator( - api WebAPIFeeSource, defaultFee SatPerKWeight) *WebAPIEstimator { - +func NewWebAPIEstimator(api WebAPIFeeSource) *WebAPIEstimator { return &WebAPIEstimator{ apiSource: api, feeByBlockTarget: make(map[uint32]uint32), - defaultFeePerKw: defaultFee, quit: make(chan struct{}), } } diff --git a/lnwallet/chainfee/estimator_test.go b/lnwallet/chainfee/estimator_test.go index b8b8186f9..d99424bca 100644 --- a/lnwallet/chainfee/estimator_test.go +++ b/lnwallet/chainfee/estimator_test.go @@ -192,7 +192,7 @@ func TestWebAPIFeeEstimator(t *testing.T) { fees: testFees, } - estimator := NewWebAPIEstimator(feeSource, 10) + estimator := NewWebAPIEstimator(feeSource) // Test that requesting a fee when no fees have been cached fails. _, err := estimator.EstimateFeePerKW(5)