diff --git a/src/estimator.cpp b/src/estimator.cpp index 20c7ea95..7a258235 100644 --- a/src/estimator.cpp +++ b/src/estimator.cpp @@ -52,7 +52,7 @@ uint64_t estimator::estimate(size_t target, mode mode) const NOEXCEPT case mode::economical: { const auto target1 = to_half(target); - const auto target2 = std::min(one, target); + const auto target2 = target; const auto target3 = std::min(large, two * target); const auto fee1 = compute(target1, confidence::low); const auto fee2 = compute(target2, confidence::mid); @@ -62,7 +62,7 @@ uint64_t estimator::estimate(size_t target, mode mode) const NOEXCEPT case mode::conservative: { const auto target1 = to_half(target); - const auto target2 = std::min(one, target); + const auto target2 = target; const auto target3 = std::min(large, two * target); const auto fee1 = compute(target1, confidence::low); const auto fee2 = compute(target2, confidence::mid); diff --git a/test/estimator.cpp b/test/estimator.cpp index a74758ad..9666f5b8 100644 --- a/test/estimator.cpp +++ b/test/estimator.cpp @@ -750,6 +750,14 @@ BC_AUTO_TEST_CASE(estimator__estimate__economical_all_targets_pass__expected) BC_REQUIRE_EQUAL(instance->estimate(1, estimator::mode::economical), 1u); } +BC_AUTO_TEST_CASE(estimator__estimate__economical_target_failed__max_uint64) +{ + const auto instance = acessor::create(); + instance->history().small[0].total = 20u; + instance->history().small[0].confirmed[4] = 10u; + BC_REQUIRE_EQUAL(instance->estimate(4, estimator::mode::economical), max_uint64); +} + BC_AUTO_TEST_CASE(estimator__estimate__conservative_double_target_failed__max_uint64) { const auto instance = acessor::create(); @@ -765,6 +773,14 @@ BC_AUTO_TEST_CASE(estimator__estimate__conservative_all_targets_pass__expected) BC_REQUIRE_EQUAL(instance->estimate(1, estimator::mode::conservative), 1u); } +BC_AUTO_TEST_CASE(estimator__estimate__conservative_target_failed__max_uint64) +{ + const auto instance = acessor::create(); + instance->history().small[0].total = 20u; + instance->history().small[0].confirmed[4] = 10u; + BC_REQUIRE_EQUAL(instance->estimate(4, estimator::mode::conservative), max_uint64); +} + // history BC_AUTO_TEST_CASE(estimator__history__const__expected) diff --git a/test/test.cpp b/test/test.cpp index d0d4cd58..1e6219f0 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -162,6 +162,7 @@ network::settings network_settings() NOEXCEPT out.enable_witness_tx = false; out.enable_compact = false; out.enable_not_found = false; + out.enable_memory_pool = false; out.enable_relay = false; out.maximum_skew_minutes = 120;