Skip to content

Commit 6de18cd

Browse files
committed
Duplicate now checked before header validation in controller, no need to do it here.
1 parent 3268679 commit 6de18cd

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

plugins/net_plugin/net_plugin.cpp

+1-15
Original file line numberDiff line numberDiff line change
@@ -3954,20 +3954,6 @@ namespace eosio {
39543954
return;
39553955
controller& cc = my_impl->chain_plug->chain();
39563956

3957-
auto fork_db_root_num = my_impl->get_fork_db_root_num();
3958-
3959-
// may have come in on a different connection and posted into dispatcher strand before this one
3960-
if( block_header::num_from_id(id) <= fork_db_root_num || my_impl->dispatcher.have_block( id ) || cc.block_exists( id ) ) { // thread-safe
3961-
boost::asio::post(c->strand, [c, id, ptr{std::move(ptr)}]() {
3962-
if (my_impl->dispatcher.add_peer_block( id, c->connection_id )) {
3963-
c->send_block_nack(id);
3964-
}
3965-
const fc::microseconds age(fc::time_point::now() - ptr->timestamp);
3966-
my_impl->sync_master->sync_recv_block( c, id, block_header::num_from_id(id), age );
3967-
});
3968-
return;
3969-
}
3970-
39713957
// proper_svnn_block_seen is for integration tests that verify low number of `unlinkable_blocks` logs.
39723958
// Because we now process blocks immediately into the fork database, during savanna transition the first proper
39733959
// savanna block will be reported as unlinkable when lib syncing. We will request that block again and by then
@@ -3989,7 +3975,7 @@ namespace eosio {
39893975
controller::accepted_block_result abh = cc.accept_block( id, ptr );
39903976
fork_db_add_result = abh.add_result;
39913977
obh = std::move(abh.block);
3992-
unlinkable = !obh;
3978+
unlinkable = fork_db_add_result == fork_db_add_t::failure;
39933979
close_mode = sync_manager::closing_mode::handshake;
39943980
} catch( const invalid_qc_claim& ex) {
39953981
exception = true;

0 commit comments

Comments
 (0)