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
2 changes: 1 addition & 1 deletion src/chasers/chaser_validate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ void chaser_validate::do_bumped(height_t height) NOEXCEPT

const auto bypass = is_under_checkpoint(height) ||
query.is_milestone(link);
const auto silent = height >= query.silent_start_height();
const auto silent = query.is_silent(link, height);

switch (ec.value())
{
Expand Down
2 changes: 1 addition & 1 deletion src/chasers/chaser_validate_parallel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ code chaser_validate::validate(bool& batched, bool& capturing, bool bypass,

// Defer block state change when batched.
// Valid must be set after set_prevouts, set_filter_body, and set_silent.
if (!batched && !bypass && !query.set_block_valid(link))
if (!batched && !query.set_block_valid(link))
return error::validate10;

return error::success;
Expand Down
19 changes: 16 additions & 3 deletions src/protocols/protocol_header_in_31800.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,26 @@ void protocol_header_in_31800::synchronize(const headers& message,
return;
}

// A message not extending the branch restarts from its stored parent.
// An unstored parent (announcement) is requested from the candidate.
// A message that does not extend the branch restarts from the parent of
// its first header. A single header with an unknown parent is an
// announcement from a peer that is ahead, so headers are requested from
// the top candidate. Multiple headers with an unknown parent are a
// response from a peer that does not connect to our locator, so the
// peer is dropped.
const auto& first = ptrs.front()->previous_block_hash();
if ((!state_ || first != state_->hash()) && !restart(first))
{
const code ec{ error::orphan_header };
if (!is_one(ptrs.size()))
{
LOGR("Headers (" << ptrs.size() << ") from [" << opposite()
<< "] " << ec.message());
stop(ec);
return;
}

LOGP("Header [" << encode_hash(ptrs.front()->get_hash()) << "] from ["
<< opposite() << "] " << code{ error::orphan_header }.message());
<< opposite() << "] " << ec.message());
SEND(create_get_headers(), handle_send, _1);
return;
}
Expand Down
Loading