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

Update sync_known_lib_num even if syncing - 2.0 #10764

Merged
merged 1 commit into from
Sep 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
6 changes: 2 additions & 4 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1451,12 +1451,12 @@ namespace eosio {
sync_source.reset();
}
if( !c ) return;
if( !closing && c->current() ) {
if( !closing ) {
std::lock_guard<std::mutex> g_conn( c->conn_mtx );
if( c->last_handshake_recv.last_irreversible_block_num > sync_known_lib_num ) {
sync_known_lib_num = c->last_handshake_recv.last_irreversible_block_num;
}
} else if ( closing ) {
} else {
// Closing connection, therefore its view of LIB can no longer be considered as we will no longer be connected.
// Determine current LIB of remaining peers as our sync_known_lib_num.
uint32_t highest_lib_num = 0;
Expand All @@ -1477,8 +1477,6 @@ namespace eosio {
sync_next_expected_num = head_blk_num + 1;
request_next_chunk( std::move(g) );
}
} else {
fc_elog( logger, "sync_reset_lib_num called on non-current connection ${cid}", ("cid", c->connection_id) );
}
}

Expand Down