Fix requeue pull for lazy bootstrap (#2825)

It should not allow unlimited requeue, instead check if new pull head was already processed
This commit is contained in:
Sergey Kroshnin 2020-06-29 17:44:47 +03:00 committed by GitHub
commit 0fd46961ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -404,7 +404,7 @@ void nano::bootstrap_connections::requeue_pull (nano::pull_info const & pull_a,
{
pull.count = attempt_l->lazy_batch_size ();
}
if (pull.attempts < pull.retry_limit + (pull.processed / nano::bootstrap_limits::requeued_pulls_processed_blocks_factor))
if (attempt_l->mode == nano::bootstrap_mode::legacy && (pull.attempts < pull.retry_limit + (pull.processed / nano::bootstrap_limits::requeued_pulls_processed_blocks_factor)))
{
{
nano::lock_guard<std::mutex> lock (mutex);