Skip to content

Commit

Permalink
GH-1072 No reason to post if syncing from peer
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Jun 5, 2023
1 parent d04757a commit c776ac9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3683,10 +3683,13 @@ namespace eosio {
// called from application thread
void net_plugin_impl::on_accepted_block_header(const block_state_ptr& bs) {
update_chain_info();
dispatcher->strand.post( [bs]() {
fc_dlog( logger, "signaled accepted_block_header, blk num = ${num}, id = ${id}", ("num", bs->block_num)("id", bs->id) );
my_impl->dispatcher->bcast_block( bs->block, bs->id );
});

if (!my_impl->sync_master->syncing_from_peer()) {
dispatcher->strand.post([bs]() {
fc_dlog(logger, "signaled accepted_block_header, blk num = ${num}, id = ${id}", ("num", bs->block_num)("id", bs->id));
my_impl->dispatcher->bcast_block(bs->block, bs->id);
});
}
}

void net_plugin_impl::on_accepted_block(const block_state_ptr& ) {
Expand Down

0 comments on commit c776ac9

Please sign in to comment.