Skip to content

Commit

Permalink
GH-830 Normally want to wait for connection monitor to reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Sep 30, 2024
1 parent b64bd34 commit 2a81eb7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ namespace eosio {

/// @param reconnect true if we should try and reconnect immediately after close
/// @param shutdown true only if plugin is shutting down
void close( bool reconnect = true, bool shutdown = false );
void close( bool reconnect = false, bool shutdown = false );
private:
void _close( bool reconnect, bool shutdown ); // for easy capture

Expand Down Expand Up @@ -1487,7 +1487,7 @@ namespace eosio {
block_sync_throttling = false;
last_vote_received = time_point{};

if( reconnect && !shutdown ) {
if( reconnect && !shutdown && !incoming() ) {
my_impl->connections.start_conn_timer( std::chrono::milliseconds( 100 ),
connection_wptr(),
connections_manager::timer_type::check );
Expand Down Expand Up @@ -2491,11 +2491,7 @@ namespace eosio {
if( mode == closing_mode::immediately || c->block_status_monitor_.max_events_violated()) {
peer_wlog(c, "block ${bn} not accepted, closing connection ${d}",
("d", mode == closing_mode::immediately ? "immediately" : "max violations reached")("bn", blk_num));
if( mode == closing_mode::immediately ) {
c->close( false ); // do not reconnect
} else {
c->close();
}
c->close(mode != closing_mode::immediately);
} else {
peer_dlog(c, "rejected block ${bn}, sending handshake", ("bn", blk_num));
c->send_handshake();
Expand Down

0 comments on commit 2a81eb7

Please sign in to comment.