diff options
author | TheCharlatan <seb.kung@gmail.com> | 2023-09-06 15:55:14 +0200 |
---|---|---|
committer | TheCharlatan <seb.kung@gmail.com> | 2023-09-12 22:51:38 +0200 |
commit | 534b314a7401d44f51aabd4565f97be9ee411740 (patch) | |
tree | 7109128d57dc16dcc99c1c0a5d4ae2553c5ae55a /src/node | |
parent | 9be330b654cfbd792620295f3867f592059d6a7a (diff) | |
download | bitcoin-534b314a7401d44f51aabd4565f97be9ee411740.tar.xz |
kernel: Move MessageStartChars to its own file
The protocol.h file contains many non-consensus related definitions and
should thus not be part of the libbitcoinkernel. This commit makes
protocol.h no longer a required include for users of the
libbitcoinkernel.
This commit is part of the libbitcoinkernel project, namely its stage 1
step 3: Decouple most non-consensus headers from libbitcoinkernel.
Co-Authored-By: Cory Fields <cory-nospam-@coryfields.com>
Diffstat (limited to 'src/node')
-rw-r--r-- | src/node/blockstorage.cpp | 3 | ||||
-rw-r--r-- | src/node/blockstorage.h | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index 2e4e077f18..253dee088e 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -11,6 +11,7 @@ #include <flatfile.h> #include <hash.h> #include <kernel/chainparams.h> +#include <kernel/messagestartchars.h> #include <logging.h> #include <pow.h> #include <reverse_iterator.h> @@ -927,7 +928,7 @@ bool BlockManager::ReadRawBlockFromDisk(std::vector<uint8_t>& block, const FlatF } try { - CMessageHeader::MessageStartChars blk_start; + MessageStartChars blk_start; unsigned int blk_size; filein >> blk_start >> blk_size; diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h index 4b57637427..b251ece31f 100644 --- a/src/node/blockstorage.h +++ b/src/node/blockstorage.h @@ -11,7 +11,7 @@ #include <kernel/blockmanager_opts.h> #include <kernel/chainparams.h> #include <kernel/cs_main.h> -#include <protocol.h> +#include <kernel/messagestartchars.h> #include <sync.h> #include <util/fs.h> #include <util/hasher.h> @@ -73,7 +73,7 @@ static const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB /** Size of header written by WriteBlockToDisk before a serialized CBlock */ -static constexpr size_t BLOCK_SERIALIZATION_HEADER_SIZE = std::tuple_size_v<CMessageHeader::MessageStartChars> + sizeof(unsigned int); +static constexpr size_t BLOCK_SERIALIZATION_HEADER_SIZE = std::tuple_size_v<MessageStartChars> + sizeof(unsigned int); extern std::atomic_bool fReindex; |