From 19180098fe2fb147f00f6bb038a6db65f9e684d0 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Wed, 10 Apr 2024 12:03:32 -0500 Subject: [PATCH] Send handshake to peer to let it know it is not syncing from us. --- plugins/net_plugin/net_plugin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/net_plugin/net_plugin.cpp b/plugins/net_plugin/net_plugin.cpp index 9d4c0f5b16..4f04dae7ca 100644 --- a/plugins/net_plugin/net_plugin.cpp +++ b/plugins/net_plugin/net_plugin.cpp @@ -2203,7 +2203,7 @@ namespace eosio { // static, thread safe void sync_manager::send_handshakes() { my_impl->connections.for_each_connection( []( const connection_ptr& ci ) { - if( ci->current() ) { + if( ci->connected() ) { ci->send_handshake(); } } ); @@ -2229,6 +2229,7 @@ namespace eosio { if( !is_sync_required( chain_info.head_num ) || target <= chain_info.lib_num ) { peer_dlog( c, "We are already caught up, my irr = ${b}, head = ${h}, target = ${t}", ("b", chain_info.lib_num)( "h", chain_info.head_num )( "t", target ) ); + c->send_handshake(); // let peer know it is not syncing from us return; } @@ -2318,8 +2319,8 @@ namespace eosio { note.known_blocks.ids.push_back(make_block_id(cc.earliest_available_block_num())); } c->enqueue( note ); + c->peer_syncing_from_us = true; } - c->peer_syncing_from_us = true; return; } @@ -2361,6 +2362,7 @@ namespace eosio { } return; } else { + c->peer_syncing_from_us = false; peer_dlog( c, "Block discrepancy is within network latency range."); } }