Skip to content

Commit

Permalink
GH-1091 Only send block_notice if in sync.
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Jan 13, 2025
1 parent 121fadc commit 35d3118
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2757,7 +2757,8 @@ namespace eosio {

if (cp->protocol_version >= proto_block_nack) {
if (cp->consecutive_blocks_nacks > connection::consecutive_block_nacks_threshold) {
if (!my_impl->is_producer(b->producer)) { // always broadcast our produced blocks
// always broadcast our produced blocks, no need for block_notice if not in sync
if (!my_impl->is_producer(b->producer) && my_impl->sync_master->is_in_sync()) {
auto send_buffer = block_id_buff_factory.get_send_buffer( block_notice_message{id} );
boost::asio::post(cp->strand, [cp, send_buffer{std::move(send_buffer)}, bnum]() {
cp->latest_blk_time = std::chrono::steady_clock::now();
Expand Down

0 comments on commit 35d3118

Please sign in to comment.