Skip to content

Commit 4fe408f

Browse files
committed
GH-1245 Don't consider a peer outside of top producers a fatal error
1 parent 75c63e3 commit 4fe408f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

plugins/net_plugin/include/eosio/net_plugin/auto_bp_peering.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ class bp_connection_manager {
315315

316316
if (invalid_message)
317317
return false;
318-
return !msg.peers.empty();
318+
319+
return true;
319320
}
320321

321322
// thread-safe

plugins/net_plugin/net_plugin.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3753,18 +3753,21 @@ namespace eosio {
37533753
return;
37543754
}
37553755

3756+
const bool first_msg = msg.peers.size() == 1 && msg.peers[0].server_address.empty();
37563757
if (!my_impl->validate_gossip_bp_peers_message(msg)) {
37573758
peer_wlog( this, "bad gossip_bp_peers_message, closing");
37583759
no_retry = go_away_reason::fatal_other;
37593760
enqueue( go_away_message( go_away_reason::fatal_other ) );
37603761
return;
37613762
}
37623763

3764+
if (msg.peers.empty())
3765+
return; // no current top producers in msg
3766+
37633767
// valid gossip peer connection
37643768
bp_connection = bp_connection_type::bp_gossip;
37653769

3766-
assert(!msg.peers.empty()); // checked by validate_gossip_bp_peers_message()
3767-
if (msg.peers.size() == 1 && msg.peers[0].server_address.empty()) {
3770+
if (first_msg) {
37683771
// initial message case, send back our entire collection
37693772
send_gossip_bp_peers_message();
37703773
} else {

0 commit comments

Comments
 (0)