lnwallet: remove unused WebAPIEstimator field

This commit is contained in:
Joost Jager 2020-09-14 11:24:12 +02:00
parent c704c5747a
commit 23cd2f40eb
No known key found for this signature in database
GPG key ID: A61B9D4C393C59C7
3 changed files with 2 additions and 10 deletions

View file

@ -257,7 +257,6 @@ func newChainControlFromConfig(cfg *Config, localDB, remoteDB *channeldb.DB,
chainfee.SparseConfFeeSource{ chainfee.SparseConfFeeSource{
URL: cfg.NeutrinoMode.FeeURL, URL: cfg.NeutrinoMode.FeeURL,
}, },
defaultBitcoinStaticFeePerKW,
) )
if err := estimator.Start(); err != nil { if err := estimator.Start(); err != nil {

View file

@ -540,23 +540,16 @@ type WebAPIEstimator struct {
feesMtx sync.Mutex feesMtx sync.Mutex
feeByBlockTarget map[uint32]uint32 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{} quit chan struct{}
wg sync.WaitGroup wg sync.WaitGroup
} }
// NewWebAPIEstimator creates a new WebAPIEstimator from a given URL and a // NewWebAPIEstimator creates a new WebAPIEstimator from a given URL and a
// fallback default fee. The fees are updated whenever a new block is mined. // fallback default fee. The fees are updated whenever a new block is mined.
func NewWebAPIEstimator( func NewWebAPIEstimator(api WebAPIFeeSource) *WebAPIEstimator {
api WebAPIFeeSource, defaultFee SatPerKWeight) *WebAPIEstimator {
return &WebAPIEstimator{ return &WebAPIEstimator{
apiSource: api, apiSource: api,
feeByBlockTarget: make(map[uint32]uint32), feeByBlockTarget: make(map[uint32]uint32),
defaultFeePerKw: defaultFee,
quit: make(chan struct{}), quit: make(chan struct{}),
} }
} }

View file

@ -192,7 +192,7 @@ func TestWebAPIFeeEstimator(t *testing.T) {
fees: testFees, fees: testFees,
} }
estimator := NewWebAPIEstimator(feeSource, 10) estimator := NewWebAPIEstimator(feeSource)
// Test that requesting a fee when no fees have been cached fails. // Test that requesting a fee when no fees have been cached fails.
_, err := estimator.EstimateFeePerKW(5) _, err := estimator.EstimateFeePerKW(5)