diff --git a/include/bitcoin/node/chasers/chaser_validate.hpp b/include/bitcoin/node/chasers/chaser_validate.hpp index 6da61143..409e4cb1 100644 --- a/include/bitcoin/node/chasers/chaser_validate.hpp +++ b/include/bitcoin/node/chasers/chaser_validate.hpp @@ -149,6 +149,7 @@ class BCN_API chaser_validate const size_t maximum_backlog_; const size_t maximum_height_; const uint64_t batch_target_; + const bool allow_batch_race_; const bool batch_enabled_; const bool node_witness_; const bool filter_; diff --git a/include/bitcoin/node/settings.hpp b/include/bitcoin/node/settings.hpp index 678f4243..7dab0408 100644 --- a/include/bitcoin/node/settings.hpp +++ b/include/bitcoin/node/settings.hpp @@ -40,6 +40,7 @@ class BCN_API settings bool thread_priority; bool memory_priority; bool allow_overlapped; + bool allow_batch_race; float allowed_deviation; float minimum_fee_rate; float minimum_bump_rate; diff --git a/src/chasers/chaser_validate.cpp b/src/chasers/chaser_validate.cpp index 8b76efe3..a31b4a89 100644 --- a/src/chasers/chaser_validate.cpp +++ b/src/chasers/chaser_validate.cpp @@ -45,6 +45,7 @@ chaser_validate::chaser_validate(full_node& node) NOEXCEPT maximum_backlog_(node.node_settings().maximum_concurrency_()), maximum_height_(node.node_settings().maximum_height_()), batch_target_(node.node_settings().batch_signatures), + allow_batch_race_(node.node_settings().allow_batch_race), batch_enabled_(node.node_settings().batch_signatures_enabled()), node_witness_(node.network_settings().witness_node()), filter_(node.archive().filter_enabled()) diff --git a/src/chasers/chaser_validate_batch.cpp b/src/chasers/chaser_validate_batch.cpp index 368960b4..99e9de13 100644 --- a/src/chasers/chaser_validate_batch.cpp +++ b/src/chasers/chaser_validate_batch.cpp @@ -60,8 +60,9 @@ void chaser_validate::push_batch(const header_link& link, size_t height) NOEXCEP batched_.push_back(link); --batch_backlog_; - // Unblocks check chaser. - notify({}, chase::prevalid, possible_wide_cast(height)); + // Unblocks check chaser for download while verifying. + if (allow_batch_race_) + notify({}, chase::prevalid, possible_wide_cast(height)); // Process both tables when one hits target, allowing batched_ clearance // and therefore forward confirmation progress. Drain batch if no backlogs diff --git a/src/settings.cpp b/src/settings.cpp index f26c8c4a..0eab52db 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -36,6 +36,7 @@ settings::settings() NOEXCEPT memory_priority{ true }, thread_priority{ true }, allow_overlapped{ true }, + allow_batch_race{ true }, batch_signatures{ 100'000 }, minimum_fee_rate{ 0.0 }, minimum_bump_rate{ 0.0 }, diff --git a/test/settings.cpp b/test/settings.cpp index 6ec65ca0..dc132a38 100644 --- a/test/settings.cpp +++ b/test/settings.cpp @@ -36,6 +36,7 @@ BOOST_AUTO_TEST_CASE(settings__node__default_context__expected) BOOST_REQUIRE_EQUAL(node.memory_priority, true); BOOST_REQUIRE_EQUAL(node.thread_priority, true); BOOST_REQUIRE_EQUAL(node.allow_overlapped, true); + BOOST_REQUIRE_EQUAL(node.allow_batch_race, true); BOOST_REQUIRE_EQUAL(node.minimum_fee_rate, 0.0); BOOST_REQUIRE_EQUAL(node.minimum_bump_rate, 0.0); BOOST_REQUIRE_EQUAL(node.allowed_deviation, 1.5);