diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 56511991ff7e..853b2fd44403 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -659,8 +659,9 @@ Threads : Started from `main()` in `bitcoind.cpp`. Responsible for starting up and shutting down the application. -- [ThreadImport (`d-loadblk`)](https://doxygen.bitcoincore.org/namespacenode.html#ab4305679079866f0f420f7dbf278381d) - : Loads blocks from `blk*.dat` files or `-loadblock=` on startup. +- [Init load (`d-initload`)](https://doxygen.bitcoincore.org/namespacenode.html#ab4305679079866f0f420f7dbf278381d) + : Performs various loading tasks that are part of init but shouldn't block the node from being started: external block import, + reindex, reindex-chainstate, main chain activation, spawn indexes background sync threads and mempool load. - [CCheckQueue::Loop (`d-scriptch.x`)](https://doxygen.bitcoincore.org/class_c_check_queue.html#a6e7fa51d3a25e7cb65446d4b50e6a987) : Parallel script validation threads for transactions in blocks. diff --git a/src/Makefile.am b/src/Makefile.am index 7069ea92ed85..de8b85445b5d 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -300,6 +300,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 \ @@ -351,6 +352,7 @@ BITCOIN_CORE_H = \ netfulfilledman.h \ netgroup.h \ netmessagemaker.h \ + node/abort.h \ node/blockmanager_args.h \ node/blockstorage.h \ node/caches.h \ @@ -465,6 +467,7 @@ BITCOIN_CORE_H = \ util/readwritefile.h \ util/result.h \ util/serfloat.h \ + util/signalinterrupt.h \ util/sock.h \ util/spanparsing.h \ util/std23.h \ @@ -639,6 +642,7 @@ libbitcoin_node_a_SOURCES = \ net_processing.cpp \ netfulfilledman.cpp \ netgroup.cpp \ + node/abort.cpp \ node/blockmanager_args.cpp \ node/blockstorage.cpp \ node/caches.cpp \ @@ -1085,6 +1089,7 @@ libbitcoin_util_a_SOURCES = \ util/moneystr.cpp \ util/ranges_set.cpp \ util/readwritefile.cpp \ + util/signalinterrupt.cpp \ util/serfloat.cpp \ util/sock.cpp \ util/spanparsing.cpp \ @@ -1349,6 +1354,7 @@ libdashkernel_la_SOURCES = \ messagesigner.cpp \ netaddress.cpp \ netbase.cpp \ + node/abort.cpp \ node/blockstorage.cpp \ node/chainstate.cpp \ node/interface_ui.cpp \ @@ -1394,6 +1400,7 @@ libdashkernel_la_SOURCES = \ util/moneystr.cpp \ util/ranges_set.cpp \ util/serfloat.cpp \ + util/signalinterrupt.cpp \ util/sock.cpp \ util/strencodings.cpp \ util/string.cpp \ diff --git a/src/addrdb.cpp b/src/addrdb.cpp index a1a536ea2b4f..8bafa5763c89 100644 --- a/src/addrdb.cpp +++ b/src/addrdb.cpp @@ -98,10 +98,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 c193f5e7801e..10271bf52909 100644 --- a/src/bench/block_assemble.cpp +++ b/src/bench/block_assemble.cpp @@ -7,6 +7,7 @@ #include #include