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.
This commit is contained in:
yyforyongyu 2021-06-24 19:57:06 +08:00
parent 5f0561fdbc
commit 1abc5f8b00
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868
3 changed files with 3 additions and 3 deletions

@ -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),
)
}

@ -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.

@ -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, ""},