aboutsummaryrefslogtreecommitdiff
path: root/src/index/coinstatsindex.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/coinstatsindex.cpp
parentd22e7ee93313b13365bd14a5fffeb055cff4dcd2 (diff)
downloadbitcoin-fafb880e8854f9b7fb3934e02a0bd0409aec72c2.tar.xz
refactor: [index] Replace deprecated char with uint8_t in serialization
Diffstat (limited to 'src/index/coinstatsindex.cpp')
-rw-r--r--src/index/coinstatsindex.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/index/coinstatsindex.cpp b/src/index/coinstatsindex.cpp
index c7c1f4b533..7c8b2b186e 100644
--- a/src/index/coinstatsindex.cpp
+++ b/src/index/coinstatsindex.cpp
@@ -12,9 +12,9 @@
#include <undo.h>
#include <validation.h>
-static constexpr char DB_BLOCK_HASH = 's';
-static constexpr char DB_BLOCK_HEIGHT = 't';
-static constexpr char DB_MUHASH = 'M';
+static constexpr uint8_t DB_BLOCK_HASH{'s'};
+static constexpr uint8_t DB_BLOCK_HEIGHT{'t'};
+static constexpr uint8_t DB_MUHASH{'M'};
namespace {
@@ -66,7 +66,7 @@ struct DBHeightKey {
template <typename Stream>
void Unserialize(Stream& s)
{
- char prefix{static_cast<char>(ser_readdata8(s))};
+ const uint8_t prefix{ser_readdata8(s)};
if (prefix != DB_BLOCK_HEIGHT) {
throw std::ios_base::failure("Invalid format for coinstatsindex DB height key");
}
@@ -81,7 +81,7 @@ struct DBHashKey {
SERIALIZE_METHODS(DBHashKey, obj)
{
- char prefix{DB_BLOCK_HASH};
+ uint8_t prefix{DB_BLOCK_HASH};
READWRITE(prefix);
if (prefix != DB_BLOCK_HASH) {
throw std::ios_base::failure("Invalid format for coinstatsindex DB hash key");