Skip to content

Commit

Permalink
Merge pull request EOSIO#7965 from EOSIO/net-plugin-unexpected-block-1.8
Browse files Browse the repository at this point in the history
Net plugin unexpected block - 1.8
  • Loading branch information
heifner authored Sep 23, 2019
2 parents b0b6704 + 0a61350 commit 9f248b1
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1396,8 +1396,8 @@ namespace eosio {
sync_known_lib_num = target;
}

if (!sync_required()) {
uint32_t bnum = chain_plug->chain().last_irreversible_block_num();
uint32_t bnum = chain_plug->chain().last_irreversible_block_num();
if (!sync_required() || target <= bnum) {
uint32_t hnum = chain_plug->chain().fork_db_pending_head_block_num();
fc_dlog( logger, "We are already caught up, my irr = ${b}, head = ${h}, target = ${t}",
("b",bnum)("h",hnum)("t",target));
Expand Down Expand Up @@ -1483,12 +1483,7 @@ namespace eosio {

if (head < msg.head_num ) {
fc_dlog(logger, "sync check state 3");
if (!verify_catchup(c, msg.head_num, msg.head_id)) {
request_message req;
req.req_blocks.mode = catch_up;
req.req_trx.mode = none;
c->enqueue( req );
}
verify_catchup(c, msg.head_num, msg.head_id);
return;
}
else {
Expand Down Expand Up @@ -1588,9 +1583,8 @@ namespace eosio {
fc_dlog(logger, "got block ${bn} from ${p}",("bn",blk_num)("p",c->peer_name()));
if (state == lib_catchup) {
if (blk_num != sync_next_expected_num) {
fc_wlog( logger, "expected block ${ne} but got ${bn}, closing connection: ${p}",
fc_wlog( logger, "expected block ${ne} but got ${bn}, from connection: ${p}",
("ne",sync_next_expected_num)("bn",blk_num)("p",c->peer_name()) );
my_impl->close(c);
return;
}
sync_next_expected_num = blk_num + 1;
Expand Down

0 comments on commit 9f248b1

Please sign in to comment.