diff options
author | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-08-01 11:01:48 +0200 |
---|---|---|
committer | MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> | 2023-08-01 15:27:23 +0200 |
commit | fa8685597e7302fc136f21b6dd3a4b187fa8e251 (patch) | |
tree | 8365d75a4d3caf8a3cae9fdf48d3e6cf76026bd6 /src/txdb.cpp | |
parent | fa69148a0a26c5054dbccdceeac8e117bf449275 (diff) |
index: Drop legacy -txindex check
Diffstat (limited to 'src/txdb.cpp')
-rw-r--r-- | src/txdb.cpp | 33 |
1 files changed, 12 insertions, 21 deletions
diff --git a/src/txdb.cpp b/src/txdb.cpp index e5b5e0b8a1..670aaab606 100644 --- a/src/txdb.cpp +++ b/src/txdb.cpp @@ -6,15 +6,23 @@ #include <txdb.h> #include <chain.h> +#include <coins.h> +#include <dbwrapper.h> +#include <kernel/cs_main.h> #include <logging.h> #include <pow.h> +#include <primitives/transaction.h> #include <random.h> +#include <serialize.h> +#include <sync.h> #include <uint256.h> #include <util/signalinterrupt.h> #include <util/translation.h> #include <util/vector.h> -#include <stdint.h> +#include <cassert> +#include <cstdlib> +#include <iterator> static constexpr uint8_t DB_COIN{'C'}; static constexpr uint8_t DB_BLOCK_FILES{'f'}; @@ -28,26 +36,9 @@ static constexpr uint8_t DB_LAST_BLOCK{'l'}; // Keys used in previous version that might still be found in the DB: static constexpr uint8_t DB_COINS{'c'}; -static constexpr uint8_t DB_TXINDEX_BLOCK{'T'}; -// uint8_t DB_TXINDEX{'t'} - -util::Result<void> CheckLegacyTxindex(CBlockTreeDB& block_tree_db) -{ - CBlockLocator ignored{}; - if (block_tree_db.Read(DB_TXINDEX_BLOCK, ignored)) { - return util::Error{_("The -txindex upgrade started by a previous version cannot be completed. Restart with the previous version or run a full -reindex.")}; - } - bool txindex_legacy_flag{false}; - block_tree_db.ReadFlag("txindex", txindex_legacy_flag); - if (txindex_legacy_flag) { - // Disable legacy txindex and warn once about occupied disk space - if (!block_tree_db.WriteFlag("txindex", false)) { - return util::Error{Untranslated("Failed to write block index db flag 'txindex'='0'")}; - } - return util::Error{_("The block index db contains a legacy 'txindex'. To clear the occupied disk space, run a full -reindex, otherwise ignore this error. This error message will not be displayed again.")}; - } - return {}; -} +// CBlockTreeDB::DB_TXINDEX_BLOCK{'T'}; +// CBlockTreeDB::DB_TXINDEX{'t'} +// CBlockTreeDB::ReadFlag("txindex") bool CCoinsViewDB::NeedsUpgrade() { |