From 0751a029c0040c82264bec6ea550b21430a2acd9 Mon Sep 17 00:00:00 2001 From: mfrankovi Date: Mon, 20 Feb 2023 15:43:40 +0100 Subject: [PATCH] fix: peer chain size --- .../network/src/tarcap/packets_handlers/vote_packet_handler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/core_libs/network/src/tarcap/packets_handlers/vote_packet_handler.cpp b/libraries/core_libs/network/src/tarcap/packets_handlers/vote_packet_handler.cpp index bf494f7e32..7bd333abc9 100644 --- a/libraries/core_libs/network/src/tarcap/packets_handlers/vote_packet_handler.cpp +++ b/libraries/core_libs/network/src/tarcap/packets_handlers/vote_packet_handler.cpp @@ -70,7 +70,7 @@ void VotePacketHandler::process(const PacketData &packet_data, const std::shared onNewPbftVote(vote, pbft_block); // Update peer's max chain size - if (peer_chain_size.has_value() && *peer_chain_size > peer->pbft_chain_size_) { + if (peer_chain_size.has_value() && vote->getVoter() == peer->getId() && *peer_chain_size > peer->pbft_chain_size_) { peer->pbft_chain_size_ = *peer_chain_size; } }