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
3 changes: 0 additions & 3 deletions core/network/impl/peer_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,6 @@ namespace kagome::network {
.new_head = header,
.lost = {},
};
if (event.view == my_view_) {
return;
}
my_view_stripped_ = std::move(stripped_view);
for (const auto &head : my_view_.heads_) {
if (not event.view.contains(head)) {
Expand Down
4 changes: 4 additions & 0 deletions core/network/impl/protocols/parachain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ namespace kagome::network {
}

void ParachainProtocol::write(const View &view) {
if (view == last_sent_view_) {
return;
}
last_sent_view_ = view;
auto message = encodeView(view);
notifications_->peersOut([&](const PeerId &peer_id, size_t protocol_group) {
notifications_->write(peer_id, protocol_group, message);
Expand Down
2 changes: 1 addition & 1 deletion core/network/impl/protocols/parachain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ namespace kagome::network {
class PeerView;
struct Seconded;
class ValidationObserver;
struct View;
} // namespace kagome::network

namespace kagome::network {
Expand Down Expand Up @@ -76,6 +75,7 @@ namespace kagome::network {
primitives::events::SyncStateSubscriptionEnginePtr sync_engine_;
std::shared_ptr<void> sync_sub_;
std::shared_ptr<void> my_view_sub_;
View last_sent_view_;
// NOLINTEND(cppcoreguidelines-non-private-member-variables-in-classes)
};

Expand Down
Loading