lnwallet: remove unused WebAPIEstimator field

This commit is contained in:
Joost Jager committed 2020-09-14 11:51:01 +02:00
1 parent c704c5747a
commit 23cd2f40eb
3 files changed
+2 -10

No files matched your search

-1
View File
@@ -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 {
+1 -8
View File
@@ -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{}),
}
}
+1 -1
View File
@@ -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)