diff --git a/src/Makefile.am b/src/Makefile.am index feed4a0061c..e542a067a47 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -191,6 +191,7 @@ BITCOIN_CORE_H = \ kernel/mempool_options.h \ kernel/mempool_persist.h \ kernel/mempool_removal_reason.h \ + kernel/messagestartchars.h \ kernel/notifications_interface.h \ kernel/validation_cache_sizes.h \ key.h \ diff --git a/src/addrdb.cpp b/src/addrdb.cpp index c5b474339b9..50f576624c6 100644 --- a/src/addrdb.cpp +++ b/src/addrdb.cpp @@ -90,10 +90,10 @@ void DeserializeDB(Stream& stream, Data&& data, bool fCheckSum = true) { HashVerifier verifier{stream}; // de-serialize file header (network specific magic number) and .. - unsigned char pchMsgTmp[4]; + MessageStartChars pchMsgTmp; verifier >> pchMsgTmp; // ... verify the network matches ours - if (memcmp(pchMsgTmp, Params().MessageStart(), sizeof(pchMsgTmp))) { + if (pchMsgTmp != Params().MessageStart()) { throw std::runtime_error{"Invalid network magic number"}; } diff --git a/src/bench/block_assemble.cpp b/src/bench/block_assemble.cpp index 4d032cefc5f..0737144b84f 100644 --- a/src/bench/block_assemble.cpp +++ b/src/bench/block_assemble.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include diff --git a/src/bench/duplicate_inputs.cpp b/src/bench/duplicate_inputs.cpp index b3799ad1b72..a1c8d4d9420 100644 --- a/src/bench/duplicate_inputs.cpp +++ b/src/bench/duplicate_inputs.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include diff --git a/src/bench/mempool_stress.cpp b/src/bench/mempool_stress.cpp index 1f94461d198..993db666531 100644 --- a/src/bench/mempool_stress.cpp +++ b/src/bench/mempool_stress.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include diff --git a/src/bitcoin-chainstate.cpp b/src/bitcoin-chainstate.cpp index 19c4d36126e..fc83a4ad3a3 100644 --- a/src/bitcoin-chainstate.cpp +++ b/src/bitcoin-chainstate.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include