Skip to content

Commit

Permalink
Logging load blocks bad result
Browse files Browse the repository at this point in the history
  • Loading branch information
ErakhtinB committed Jan 10, 2025
1 parent 6df59ac commit 9337b28
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions core/network/impl/synchronizer_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,27 @@ namespace kagome::network {

if (parent_is_known) {
for (const auto &p_id : selected_peers) {
loadBlocks(p_id, block_info, [wp{weak_from_this()}](auto res) {
if (auto self = wp.lock()) {
SL_TRACE(self->log_, "Block(s) enqueued to apply by announce");
}
});
loadBlocks(
p_id,
block_info,
[wp{weak_from_this()}, p_id, block_info](auto res) {
if (auto self = wp.lock()) {
if (res.has_error()) {
SL_DEBUG(
self->log_,
"Can't load blocks starting from {} from peer {}: {}",
block_info,
p_id,
res.error());
} else {
SL_TRACE(self->log_,
"Block(s) from {} enqueued to load by announce from "
"peer {}",
block_info,
p_id);
}
}
});
}
return true;
}
Expand Down

0 comments on commit 9337b28

Please sign in to comment.