aboutsummaryrefslogtreecommitdiff
path: root/src/index/txindex.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2021-05-01 13:49:37 +0200
committerMarcoFalke <falke.marco@gmail.com>2021-05-01 13:48:42 +0200
commitfafb880e8854f9b7fb3934e02a0bd0409aec72c2 (patch)
treec7bc7f2b4b47c2188ac29afde951390360e7ef28 /src/index/txindex.cpp
parentd22e7ee93313b13365bd14a5fffeb055cff4dcd2 (diff)
refactor: [index] Replace deprecated char with uint8_t in serialization
Diffstat (limited to 'src/index/txindex.cpp')
-rw-r--r--src/index/txindex.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/index/txindex.cpp b/src/index/txindex.cpp
index f41985c344..06f5910238 100644
--- a/src/index/txindex.cpp
+++ b/src/index/txindex.cpp
@@ -10,14 +10,13 @@
#include <util/translation.h>
#include <validation.h>
-constexpr char DB_BEST_BLOCK = 'B';
-constexpr char DB_TXINDEX = 't';
-constexpr char DB_TXINDEX_BLOCK = 'T';
+constexpr uint8_t DB_BEST_BLOCK{'B'};
+constexpr uint8_t DB_TXINDEX{'t'};
+constexpr uint8_t DB_TXINDEX_BLOCK{'T'};
std::unique_ptr<TxIndex> g_txindex;
-
/** Access to the txindex database (indexes/txindex/) */
class TxIndex::DB : public BaseIndex::DB
{
@@ -60,8 +59,8 @@ bool TxIndex::DB::WriteTxs(const std::vector<std::pair<uint256, CDiskTxPos>>& v_
*/
static void WriteTxIndexMigrationBatches(CDBWrapper& newdb, CDBWrapper& olddb,
CDBBatch& batch_newdb, CDBBatch& batch_olddb,
- const std::pair<unsigned char, uint256>& begin_key,
- const std::pair<unsigned char, uint256>& end_key)
+ const std::pair<uint8_t, uint256>& begin_key,
+ const std::pair<uint8_t, uint256>& end_key)
{
// Sync new DB changes to disk before deleting from old DB.
newdb.WriteBatch(batch_newdb, /*fSync=*/ true);
@@ -113,9 +112,9 @@ bool TxIndex::DB::MigrateData(CBlockTreeDB& block_tree_db, const CBlockLocator&
CDBBatch batch_newdb(*this);
CDBBatch batch_olddb(block_tree_db);
- std::pair<unsigned char, uint256> key;
- std::pair<unsigned char, uint256> begin_key{DB_TXINDEX, uint256()};
- std::pair<unsigned char, uint256> prev_key = begin_key;
+ std::pair<uint8_t, uint256> key;
+ std::pair<uint8_t, uint256> begin_key{DB_TXINDEX, uint256()};
+ std::pair<uint8_t, uint256> prev_key = begin_key;
bool interrupted = false;
std::unique_ptr<CDBIterator> cursor(block_tree_db.NewIterator());