Skip to content

Commit f45de1f

Browse files
authored
Merge pull request #950 from AntelopeIO/p2p-shutdown
P2P: Check for is_quitting() for faster shutdown
2 parents d3d51ff + b6f274b commit f45de1f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

plugins/net_plugin/net_plugin.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -3694,6 +3694,8 @@ namespace eosio {
36943694
// post to dispatcher strand so that we don't have multiple threads validating the block header
36953695
peer_dlog(this, "posting block ${n} to dispatcher strand", ("n", ptr->block_num()));
36963696
my_impl->dispatcher.strand.post([id, c{shared_from_this()}, ptr{std::move(ptr)}, cid=connection_id]() mutable {
3697+
if (app().is_quiting()) // large sync span can have many of these queued up, exit quickly
3698+
return;
36973699
controller& cc = my_impl->chain_plug->chain();
36983700

36993701
auto fork_db_root_num = my_impl->get_fork_db_root_num();

0 commit comments

Comments
 (0)