From aa1ef3144b1b4ef1bd421da4a992e58cbf87a0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Wo=CC=81jcik?= <3044353+pwojcikdev@users.noreply.github.com> Date: Thu, 8 Feb 2024 18:51:55 +0100 Subject: [PATCH] Add `bootstrap_legacy` source --- nano/lib/stats_enums.hpp | 1 + nano/node/blockprocessor.hpp | 1 + nano/node/bootstrap/bootstrap_attempt.cpp | 2 +- nano/node/bootstrap/bootstrap_lazy.cpp | 2 +- nano/node/bootstrap_ascending/service.cpp | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/nano/lib/stats_enums.hpp b/nano/lib/stats_enums.hpp index e72e3607b9..9a726472e7 100644 --- a/nano/lib/stats_enums.hpp +++ b/nano/lib/stats_enums.hpp @@ -115,6 +115,7 @@ enum class detail : uint8_t // blockprocessor result live, bootstrap, + bootstrap_legacy, unchecked, local, forced, diff --git a/nano/node/blockprocessor.hpp b/nano/node/blockprocessor.hpp index 31542b44c6..bf3c59ef04 100644 --- a/nano/node/blockprocessor.hpp +++ b/nano/node/blockprocessor.hpp @@ -25,6 +25,7 @@ enum class block_source unknown = 0, live, bootstrap, + bootstrap_legacy, unchecked, local, forced, diff --git a/nano/node/bootstrap/bootstrap_attempt.cpp b/nano/node/bootstrap/bootstrap_attempt.cpp index 8d892db2e2..3f78beff2a 100644 --- a/nano/node/bootstrap/bootstrap_attempt.cpp +++ b/nano/node/bootstrap/bootstrap_attempt.cpp @@ -133,7 +133,7 @@ bool nano::bootstrap_attempt::process_block (std::shared_ptr const } else { - node_l->block_processor.add (block_a); + node_l->block_processor.add (block_a, nano::block_source::bootstrap_legacy); } return stop_pull; } diff --git a/nano/node/bootstrap/bootstrap_lazy.cpp b/nano/node/bootstrap/bootstrap_lazy.cpp index 0d3dbc9408..d69916a9c9 100644 --- a/nano/node/bootstrap/bootstrap_lazy.cpp +++ b/nano/node/bootstrap/bootstrap_lazy.cpp @@ -311,7 +311,7 @@ bool nano::bootstrap_attempt_lazy::process_block_lazy (std::shared_ptrblock_processor.add (block_a); + node->block_processor.add (block_a, nano::block_source::bootstrap_legacy); } // Force drop lazy bootstrap connection for long bulk_pull if (pull_blocks_processed > max_blocks) diff --git a/nano/node/bootstrap_ascending/service.cpp b/nano/node/bootstrap_ascending/service.cpp index 23cd499113..d091b64464 100644 --- a/nano/node/bootstrap_ascending/service.cpp +++ b/nano/node/bootstrap_ascending/service.cpp @@ -387,7 +387,7 @@ void nano::bootstrap_ascending::service::process (const nano::asc_pull_ack::bloc for (auto & block : response.blocks) { - block_processor.add (block); + block_processor.add (block, nano::block_source::bootstrap); } nano::lock_guard lock{ mutex }; throttle.add (true);