From 57c2210e4a6168c85d14d2d0f7014415dc6395e3 Mon Sep 17 00:00:00 2001 From: clemahieu Date: Wed, 8 Jun 2022 12:40:59 +0100 Subject: [PATCH] Removing unchecked.for_each_par as it's effectively unused. This disables migrating of unchecked table from lmdb to rocksdb, however, this upgrade really isn't needed. --- nano/secure/ledger.cpp | 9 --------- nano/secure/store.hpp | 1 - nano/secure/store/unchecked_store_partial.hpp | 11 ----------- 3 files changed, 21 deletions(-) diff --git a/nano/secure/ledger.cpp b/nano/secure/ledger.cpp index 5850e6af1c..a0199b840a 100644 --- a/nano/secure/ledger.cpp +++ b/nano/secure/ledger.cpp @@ -1438,15 +1438,6 @@ bool nano::ledger::migrate_lmdb_to_rocksdb (boost::filesystem::path const & data } }); - store.unchecked.for_each_par ( - [&rocksdb_store] (nano::read_transaction const & /*unused*/, auto i, auto n) { - for (; i != n; ++i) - { - auto rocksdb_transaction (rocksdb_store->tx_begin_write ({}, { nano::tables::unchecked })); - rocksdb_store->unchecked.put (rocksdb_transaction, i->first, i->second); - } - }); - store.pending.for_each_par ( [&rocksdb_store] (nano::read_transaction const & /*unused*/, auto i, auto n) { for (; i != n; ++i) diff --git a/nano/secure/store.hpp b/nano/secure/store.hpp index 5dbbf8f85c..c236ced940 100644 --- a/nano/secure/store.hpp +++ b/nano/secure/store.hpp @@ -753,7 +753,6 @@ class unchecked_store virtual nano::store_iterator begin (nano::transaction const &, nano::unchecked_key const &) const = 0; virtual nano::store_iterator end () const = 0; virtual size_t count (nano::transaction const &) = 0; - virtual void for_each_par (std::function, nano::store_iterator)> const & action_a) const = 0; }; /** diff --git a/nano/secure/store/unchecked_store_partial.hpp b/nano/secure/store/unchecked_store_partial.hpp index 299feec8b4..9d519a14a9 100644 --- a/nano/secure/store/unchecked_store_partial.hpp +++ b/nano/secure/store/unchecked_store_partial.hpp @@ -83,17 +83,6 @@ class unchecked_store_partial : public unchecked_store { return store.count (transaction_a, tables::unchecked); } - - void for_each_par (std::function, nano::store_iterator)> const & action_a) const override - { - parallel_traversal ( - [&action_a, this] (nano::uint512_t const & start, nano::uint512_t const & end, bool const is_last) { - nano::unchecked_key key_start (start); - nano::unchecked_key key_end (end); - auto transaction (this->store.tx_begin_read ()); - action_a (transaction, this->begin (transaction, key_start), !is_last ? this->begin (transaction, key_end) : this->end ()); - }); - } }; }