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
9 changes: 3 additions & 6 deletions src/protocols/protocol_block_in_31800.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ bool protocol_block_in_31800::handle_receive_block(const code& ec,
const auto height = it->context.height;
const auto checked = is_under_checkpoint(height);
const auto bypass = checked || query.is_milestone(link);
if (bypass && node_pruned_ && block.is_segregated())
if (node_pruned_ && bypass && block.is_segregated())
{
LOGR("Unexpected witness from [" << opposite() << "].");
stop(system::error::unexpected_witness);
Expand Down Expand Up @@ -440,11 +440,8 @@ bool protocol_block_in_31800::is_under_checkpoint(size_t height) const NOEXCEPT
type_id protocol_block_in_31800::to_block_type(
const association& item) const NOEXCEPT
{
const auto stripped = node_pruned_ &&
(is_under_checkpoint(item.context.height) ||
archive().is_milestone(item.link));

return stripped ? type_id::block : block_type_;
return node_pruned_ && (is_under_checkpoint(item.context.height) ||
archive().is_milestone(item.link)) ? type_id::block : block_type_;
}

BC_POP_WARNING()
Expand Down
9 changes: 3 additions & 6 deletions src/protocols/protocol_block_out_106.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,10 @@ void protocol_block_out_106::send_block(const code& ec) NOEXCEPT

const auto& query = archive();
const auto link = query.to_header(item.hash);
if (witness && node_witness_ && node_pruned_ &&
(is_under_checkpoint(link) || query.is_milestone(link)))
if (node_pruned_ && (is_under_checkpoint(link) || query.is_milestone(link)))
{
LOGR("Request of witness for stripped block "
<< encode_hash(item.hash) << " from [" << opposite() << "].");

// The peer should not be asking for this block with witness.
LOGR("Requested pruned block " << encode_hash(item.hash)
<< " from [" << opposite() << "].");
stop(system::error::not_found);
return;
}
Expand Down
Loading