Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/bitcoin/node/chasers/chaser_check.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class BCN_API chaser_check
const float allowed_deviation_;
const size_t maximum_concurrency_;
const size_t maximum_height_;
const size_t bypass_height_;
const size_t connections_;
const size_t step_;

Expand Down
8 changes: 7 additions & 1 deletion src/chasers/chaser_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ chaser_check::chaser_check(full_node& node) NOEXCEPT
allowed_deviation_(node.node_settings().allowed_deviation),
maximum_concurrency_(node.node_settings().maximum_concurrency_()),
maximum_height_(node.node_settings().maximum_height_()),
bypass_height_(std::max(node.system_settings().milestone.height(),
node.system_settings().top_checkpoint().height())),
connections_(get_target_connections(node.network_settings())),
step_(get_step(connections_, maximum_concurrency_))
{
Expand Down Expand Up @@ -509,10 +511,14 @@ size_t chaser_check::set_unassociated() NOEXCEPT
// The last request (requested_) stops at the last gap in the window, but
// validation continues until the next gap. Start next scan above validated
// not last requested, since all between are already downloaded.
// Bypassed blocks may archive unprobed, so the window must not extend
// above the bypass height until all blocks at/below it are associated.
const auto& query = archive();
const auto previous = requested_;
const auto step = ceilinged_add(position(), maximum_concurrency_);
const auto stop = std::min(step, maximum_height_);
const auto span = std::min(step, maximum_height_);
const auto stop = position() < bypass_height_ ?
std::min(span, bypass_height_) : span;
size_t count{};

while (true)
Expand Down
3 changes: 1 addition & 2 deletions test/functional/p2p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ BOOST_AUTO_TEST_CASE(functional_p2p__handshake__default__provides_network_and_wi
{
BOOST_REQUIRE(handshake());
BOOST_REQUIRE_EQUAL(node_version->value, config_.network.protocol_maximum);
BOOST_REQUIRE_EQUAL(node_version->services,
service::node_network | service::node_witness);
BOOST_REQUIRE_EQUAL(node_version->services, service::node_network | service::node_witness);
}

BOOST_AUTO_TEST_CASE(functional_p2p__ping__nonce__pong_echo)
Expand Down
Loading