Browse Source

chainfee: change min conf target to be 1

This commit changes the minBlockTarget used by the WebAPIEstimator to be
1, inline with the bitcoind's accepted min conf target.
master
yyforyongyu 3 years ago
parent
commit
1abc5f8b00
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868
  1. 2
      lntest/fee_service_test.go
  2. 2
      lnwallet/chainfee/estimator.go
  3. 2
      lnwallet/chainfee/estimator_test.go

2
lntest/fee_service_test.go

@ -34,6 +34,6 @@ func TestFeeService(t *testing.T) {
require.NoError(t, err)
require.Equal(
t, "{\"fee_by_block_target\":{\"2\":20000}}", string(body),
t, "{\"fee_by_block_target\":{\"1\":20000}}", string(body),
)
}

2
lnwallet/chainfee/estimator.go

@ -24,7 +24,7 @@ const (
// minBlockTarget is the lowest number of blocks confirmations that
// a WebAPIEstimator will cache fees for. Requesting an estimate for
// less than this will result in an error.
minBlockTarget uint32 = 2
minBlockTarget uint32 = 1
// minFeeUpdateTimeout represents the minimum interval in which a
// WebAPIEstimator will request fresh fees from its API.

2
lnwallet/chainfee/estimator_test.go

@ -172,7 +172,7 @@ func TestWebAPIFeeEstimator(t *testing.T) {
est uint32
err string
}{
{"target_below_min", 1, 12345, 12345, "too low, minimum"},
{"target_below_min", 0, 12345, 12345, "too low, minimum"},
{"target_w_too-low_fee", 10, 42, feeFloor, ""},
{"API-omitted_target", 2, 0, 0, "web API does not include"},
{"valid_target", 20, 54321, 54321, ""},

Loading…
Cancel
Save