Skip to content

Commit

Permalink
Reschedule enqueue_sync_block
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Oct 7, 2024
1 parent 5e32912 commit 7f2f7e0
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 @@ -1766,6 +1766,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>(strand);
throttle_timer->expires_from_now(std::chrono::milliseconds(100));
throttle_timer->async_wait([this, throttle_timer](const boost::system::error_code& ec) {
if (!ec)
enqueue_sync_block();
});
return false;
}
}
Expand Down

0 comments on commit 7f2f7e0

Please sign in to comment.