From a221e4d7c2b02ea9eee75ec95b86379b71d4f4f9 Mon Sep 17 00:00:00 2001 From: Sergey Kroshnin Date: Mon, 9 Sep 2019 13:49:39 +0300 Subject: [PATCH] Apply review changes --- nano/node/bootstrap/bootstrap.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nano/node/bootstrap/bootstrap.cpp b/nano/node/bootstrap/bootstrap.cpp index 592f28e9bc..c95e950165 100644 --- a/nano/node/bootstrap/bootstrap.cpp +++ b/nano/node/bootstrap/bootstrap.cpp @@ -306,9 +306,9 @@ unsigned nano::bootstrap_attempt::target_connections (size_t pulls_remaining) } // Only scale up to bootstrap_connections_max for large pulls. - double step = std::min (1.0, std::max (0.0, (double)pulls_remaining / nano::bootstrap_limits::bootstrap_connection_scale_target_blocks)); - double lazy_factor = (mode == nano::bootstrap_mode::lazy) ? (double)node->config.bootstrap_connections : 0.0; - double target = (double)node->config.bootstrap_connections + (double)(node->config.bootstrap_connections_max - node->config.bootstrap_connections) * step + lazy_factor; + double step_scale = std::min (1.0, std::max (0.0, (double)pulls_remaining / nano::bootstrap_limits::bootstrap_connection_scale_target_blocks)); + double lazy_term = (mode == nano::bootstrap_mode::lazy) ? (double)node->config.bootstrap_connections : 0.0; + double target = (double)node->config.bootstrap_connections + (double)(node->config.bootstrap_connections_max - node->config.bootstrap_connections) * step_scale + lazy_term; return std::max (1U, (unsigned)(target + 0.5f)); } @@ -756,7 +756,7 @@ bool nano::bootstrap_attempt::process_block_lazy (std::shared_ptr b } lazy_blocks.insert (hash); // Adding lazy balances for first processed block in pull - if (pull_blocks == 0 && (block_a->type () == nano::block_type::send || block_a->type () == nano::block_type::send)) + if (pull_blocks == 0 && (block_a->type () == nano::block_type::state || block_a->type () == nano::block_type::send)) { lazy_balances.insert (std::make_pair (hash, block_a->balance ().number ())); }