Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.0] P2P: Fix handling of known pending block #2401

Merged
merged 1 commit into from
Aug 7, 2024
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
11 changes: 3 additions & 8 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2400,7 +2400,7 @@ namespace eosio {
if (msg.known_blocks.ids.empty()) {
peer_wlog( c, "got a catch up with ids size = 0" );
} else {
const block_id_type& id = msg.known_blocks.ids.back();
const block_id_type& id = msg.known_blocks.ids.front();
peer_ilog( c, "notice_message, pending ${p}, blk_num ${n}, id ${id}...",
("p", msg.known_blocks.pending)("n", block_header::num_from_id(id))("id",id.str().substr(8,16)) );
if( !my_impl->dispatcher->have_block( id ) ) {
Expand Down Expand Up @@ -2690,12 +2690,7 @@ namespace eosio {
return;
}
if (msg.known_blocks.mode == normal) {
// known_blocks.ids is never > 1
if( !msg.known_blocks.ids.empty() ) {
if( msg.known_blocks.pending == 1 ) { // block id notify of 2.0.0, ignore
return;
}
}
return;
} else if (msg.known_blocks.mode != none) {
peer_wlog( c, "passed a notice_message with something other than a normal on none known_blocks" );
return;
Expand Down Expand Up @@ -3547,7 +3542,7 @@ namespace eosio {
}
if( msg.known_trx.mode != none ) {
if( logger.is_enabled( fc::log_level::debug ) ) {
const block_id_type& blkid = msg.known_blocks.ids.empty() ? block_id_type{} : msg.known_blocks.ids.back();
const block_id_type& blkid = msg.known_blocks.ids.empty() ? block_id_type{} : msg.known_blocks.ids.front();
peer_dlog( this, "this is a ${m} notice with ${n} pending blocks: ${num} ${id}...",
("m", modes_str( msg.known_blocks.mode ))("n", msg.known_blocks.pending)
("num", block_header::num_from_id( blkid ))("id", blkid.str().substr( 8, 16 )) );
Expand Down
Loading