Skip to content

Commit

Permalink
Merge remote-tracking branch 'spring/release/1.0' into revert-870-rev…
Browse files Browse the repository at this point in the history
…ert-853-GH-525-p2p-resolve
  • Loading branch information
heifner committed Oct 7, 2024
2 parents 4c9e293 + 9a1d68b commit 5c194a3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions plugins/net_plugin/net_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1769,6 +1769,12 @@ namespace eosio {
if( current_rate_sec >= block_sync_rate_limit ) {
block_sync_throttling = true;
peer_dlog( this, "throttling block sync to peer ${host}:${port}", ("host", log_remote_endpoint_ip)("port", log_remote_endpoint_port));
std::shared_ptr<boost::asio::steady_timer> throttle_timer = std::make_shared<boost::asio::steady_timer>(my_impl->thread_pool.get_executor());
throttle_timer->expires_from_now(std::chrono::milliseconds(100));
throttle_timer->async_wait(boost::asio::bind_executor(strand, [c=shared_from_this(), throttle_timer](const boost::system::error_code& ec) {
if (!ec)
c->enqueue_sync_block();
}));
return false;
}
}
Expand Down

0 comments on commit 5c194a3

Please sign in to comment.