Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Always attempt to resync when receiving a block less than LIB. #10434

Merged
merged 3 commits into from
Jun 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2918,15 +2918,13 @@ namespace eosio {
std::unique_lock<std::mutex> g( conn_mtx );
const auto last_sent_lib = last_handshake_sent.last_irreversible_block_num;
g.unlock();
if( blk_num < last_sent_lib ) {
fc_ilog( logger, "received block ${n} less than sent lib ${lib}", ("n", blk_num)("lib", last_sent_lib) );
close();
} else {
fc_ilog( logger, "received block ${n} less than lib ${lib}", ("n", blk_num)("lib", lib) );
enqueue( (sync_request_message) {0, 0} );
send_handshake();
cancel_wait();
}

fc_ilog( logger, "received block ${n} less than ${which}lib ${lib}",
("n", blk_num)("which", blk_num < last_sent_lib ? "sent " : "")
("lib", blk_num < last_sent_lib ? last_sent_lib : lib) );
enqueue( (sync_request_message) {0, 0} );
send_handshake();
cancel_wait();

pending_message_buffer.advance_read_ptr( message_length );
return true;
Expand Down