diff --git a/ci/test/06_script_b.sh b/ci/test/06_script_b.sh index 369da6c76482f..292174c90bb7b 100755 --- a/ci/test/06_script_b.sh +++ b/ci/test/06_script_b.sh @@ -54,6 +54,7 @@ if [ "${RUN_TIDY}" = "true" ]; then src/kernel \ src/node/blockmanager_args.cpp \ src/node/chainstate.cpp \ + src/node/chainstatemanager_notifications.cpp \ src/node/chainstatemanager_args.cpp \ src/node/mempool_args.cpp \ src/node/minisketchwrapper.cpp \ diff --git a/src/Makefile.am b/src/Makefile.am index 9e1fab869d6ba..cdee6b1c175e9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -143,6 +143,7 @@ BITCOIN_CORE_H = \ compat/compat.h \ compat/cpuid.h \ compat/endian.h \ + common/system.h \ compressor.h \ consensus/consensus.h \ consensus/tx_check.h \ @@ -207,6 +208,7 @@ BITCOIN_CORE_H = \ node/caches.h \ node/chainstate.h \ node/chainstatemanager_args.h \ + node/chainstatemanager_notifications.h \ node/coin.h \ node/coins_view_args.h \ node/connection_types.h \ @@ -277,6 +279,7 @@ BITCOIN_CORE_H = \ txrequest.h \ undo.h \ util/asmap.h \ + util/batchpriority.h \ util/bip32.h \ util/bitdeque.h \ util/bytevectorhash.h \ @@ -308,7 +311,6 @@ BITCOIN_CORE_H = \ util/string.h \ util/syscall_sandbox.h \ util/syserror.h \ - util/system.h \ util/thread.h \ util/threadinterrupt.h \ util/threadnames.h \ @@ -399,6 +401,7 @@ libbitcoin_node_a_SOURCES = \ node/caches.cpp \ node/chainstate.cpp \ node/chainstatemanager_args.cpp \ + node/chainstatemanager_notifications.cpp \ node/coin.cpp \ node/coins_view_args.cpp \ node/connection_types.cpp \ @@ -655,6 +658,7 @@ libbitcoin_common_a_SOURCES = \ common/init.cpp \ common/interfaces.cpp \ common/run_command.cpp \ + common/system.cpp \ compressor.cpp \ core_read.cpp \ core_write.cpp \ @@ -706,6 +710,7 @@ libbitcoin_util_a_SOURCES = \ support/cleanse.cpp \ sync.cpp \ util/asmap.cpp \ + util/batchpriority.cpp \ util/bip32.cpp \ util/bytevectorhash.cpp \ util/chaintype.cpp \ @@ -719,7 +724,6 @@ libbitcoin_util_a_SOURCES = \ util/hasher.cpp \ util/sock.cpp \ util/syserror.cpp \ - util/system.cpp \ util/message.cpp \ util/moneystr.cpp \ util/rbf.cpp \ @@ -930,7 +934,6 @@ libbitcoinkernel_la_SOURCES = \ logging.cpp \ node/blockstorage.cpp \ node/chainstate.cpp \ - node/interface_ui.cpp \ node/utxo_snapshot.cpp \ policy/feerate.cpp \ policy/fees.cpp \ @@ -958,6 +961,7 @@ libbitcoinkernel_la_SOURCES = \ txdb.cpp \ txmempool.cpp \ uint256.cpp \ + util/batchpriority.cpp \ util/chaintype.cpp \ util/check.cpp \ util/exception.cpp \ @@ -973,7 +977,6 @@ libbitcoinkernel_la_SOURCES = \ util/string.cpp \ util/syscall_sandbox.cpp \ util/syserror.cpp \ - util/system.cpp \ util/thread.cpp \ util/threadnames.cpp \ util/time.cpp \ diff --git a/src/banman.cpp b/src/banman.cpp index 5b2049d654813..a96b7e3c536c0 100644 --- a/src/banman.cpp +++ b/src/banman.cpp @@ -5,11 +5,11 @@ #include +#include #include #include #include #include -#include #include #include diff --git a/src/bench/checkqueue.cpp b/src/bench/checkqueue.cpp index 8ad6fde6bffef..70e0b86ebaa1c 100644 --- a/src/bench/checkqueue.cpp +++ b/src/bench/checkqueue.cpp @@ -4,11 +4,11 @@ #include #include +#include #include #include #include #include -#include #include diff --git a/src/bitcoin-chainstate.cpp b/src/bitcoin-chainstate.cpp index 16c3bfb708137..b0291d3da387e 100644 --- a/src/bitcoin-chainstate.cpp +++ b/src/bitcoin-chainstate.cpp @@ -86,6 +86,13 @@ int main(int argc, char* argv[]) .chainparams = *chainparams, .datadir = gArgs.GetDataDirNet(), .adjusted_time_callback = NodeClock::now, + .notification_callbacks = ChainstateManager::NotificationCallbacks{ + .notify_block_tip = [](SynchronizationState state, CBlockIndex* index) { std::cout << "Block tip changed" << std::endl; }, + .notify_header_tip = [](SynchronizationState, int64_t height, int64_t timestamp, bool presync) { std::cout << "Header tip changed: " << height << ", " << timestamp << ", " << presync << std::endl; }, + .show_progress = [](const std::string& title, int nProgress, bool resume_possible) { std::cout << "Progress: " << title << ", " << nProgress << ", " << resume_possible << std::endl; }, + .do_warning = [](const bilingual_str& warning) { std::cout << "Warning: " << warning.original << std::endl; }, + .init_error = [](const bilingual_str& user_message) { std::cout << "Init error: " << user_message.original << std::endl; }, + }, }; const node::BlockManager::Options blockman_opts{ .chainparams = chainman_opts.chainparams, diff --git a/src/bitcoin-cli.cpp b/src/bitcoin-cli.cpp index 48dc11b95a564..45db7a9a66cb1 100644 --- a/src/bitcoin-cli.cpp +++ b/src/bitcoin-cli.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -23,7 +24,6 @@ #include #include #include -#include #include #include diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp index e291f20a11cfb..0c25ddf3738b8 100644 --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -27,7 +28,6 @@ #include #include #include -#include #include #include diff --git a/src/bitcoin-util.cpp b/src/bitcoin-util.cpp index f62a9f7bbfb00..582c18c9c6024 100644 --- a/src/bitcoin-util.cpp +++ b/src/bitcoin-util.cpp @@ -12,11 +12,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include diff --git a/src/bitcoin-wallet.cpp b/src/bitcoin-wallet.cpp index 1863173aa8838..d5dfbbec2713a 100644 --- a/src/bitcoin-wallet.cpp +++ b/src/bitcoin-wallet.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -18,7 +19,6 @@ #include #include #include -#include #include #include diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index e476b06017428..aefb130e9c50d 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -25,7 +26,6 @@ #include #include #include -#include #include #include #include diff --git a/src/blockencodings.cpp b/src/blockencodings.cpp index a29e4f794e901..9aa0a6ba2042f 100644 --- a/src/blockencodings.cpp +++ b/src/blockencodings.cpp @@ -3,16 +3,16 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include +#include +#include #include #include -#include #include #include #include #include #include #include -#include #include diff --git a/src/util/system.cpp b/src/common/system.cpp similarity index 85% rename from src/util/system.cpp rename to src/common/system.cpp index 598e6adb88621..1d1c5fa56ad58 100644 --- a/src/util/system.cpp +++ b/src/common/system.cpp @@ -3,20 +3,13 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include +#include #include #include -#include #include -#if (defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)) -#include -#include -#endif - #ifndef WIN32 -#include #include #else #include @@ -112,14 +105,3 @@ int64_t GetStartupTime() { return nStartupTime; } - -void ScheduleBatchPriority() -{ -#ifdef SCHED_BATCH - const static sched_param param{}; - const int rc = pthread_setschedparam(pthread_self(), SCHED_BATCH, ¶m); - if (rc != 0) { - LogPrintf("Failed to pthread_setschedparam: %s\n", SysErrorString(rc)); - } -#endif -} diff --git a/src/util/system.h b/src/common/system.h similarity index 84% rename from src/util/system.h rename to src/common/system.h index e2fc3450f695d..153e8aef5407c 100644 --- a/src/util/system.h +++ b/src/common/system.h @@ -3,8 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef BITCOIN_UTIL_SYSTEM_H -#define BITCOIN_UTIL_SYSTEM_H +#ifndef BITCOIN_COMMON_SYSTEM_H +#define BITCOIN_COMMON_SYSTEM_H #if defined(HAVE_CONFIG_H) #include @@ -36,13 +36,6 @@ void runCommand(const std::string& strCommand); */ int GetNumCores(); -/** - * On platforms that support it, tell the kernel the calling thread is - * CPU-intensive and non-interactive. See SCHED_BATCH in sched(7) for details. - * - */ -void ScheduleBatchPriority(); - namespace util { //! Simplification of std insertion @@ -69,4 +62,4 @@ T* AnyPtr(const std::any& any) noexcept } // namespace util -#endif // BITCOIN_UTIL_SYSTEM_H +#endif // BITCOIN_COMMON_SYSTEM_H diff --git a/src/core_write.cpp b/src/core_write.cpp index b0e3b0b3c43c0..54ca306f60198 100644 --- a/src/core_write.cpp +++ b/src/core_write.cpp @@ -4,6 +4,7 @@ #include +#include #include #include #include @@ -17,7 +18,6 @@ #include #include #include -#include #include #include diff --git a/src/external_signer.h b/src/external_signer.h index 90f07478e3e2b..81a601811a6df 100644 --- a/src/external_signer.h +++ b/src/external_signer.h @@ -5,8 +5,8 @@ #ifndef BITCOIN_EXTERNAL_SIGNER_H #define BITCOIN_EXTERNAL_SIGNER_H +#include #include -#include #include #include diff --git a/src/init.cpp b/src/init.cpp index 52c5780ed4e6e..697d5e0d80df2 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -43,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -79,13 +81,13 @@ #include #include #include -#include #include #include #include #include #include #include +#include #include #include @@ -122,6 +124,7 @@ using node::CacheSizes; using node::CalculateCacheSizes; using node::DEFAULT_PERSIST_MEMPOOL; using node::DEFAULT_PRINTPRIORITY; +using node::DefaultChainstateManagerNotifications; using node::fReindex; using node::LoadChainstate; using node::MempoolPath; @@ -1445,13 +1448,16 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) .chainparams = chainparams, .datadir = args.GetDataDirNet(), .adjusted_time_callback = GetAdjustedTime, + .notification_callbacks = DefaultChainstateManagerNotifications(), }; Assert(!ApplyArgsManOptions(args, chainman_opts)); // no error can happen, already checked in AppInitParameterInteraction BlockManager::Options blockman_opts{ .chainparams = chainman_opts.chainparams, .blocks_dir = args.GetBlocksDirPath(), - }; + .init_error_callback = [](const bilingual_str& user_message) { + InitError(user_message); + }}; Assert(!ApplyArgsManOptions(args, blockman_opts)); // no error can happen, already checked in AppInitParameterInteraction // cache size calculations diff --git a/src/ipc/interfaces.cpp b/src/ipc/interfaces.cpp index d804d9d291fb8..e446cc98db518 100644 --- a/src/ipc/interfaces.cpp +++ b/src/ipc/interfaces.cpp @@ -2,6 +2,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include #include #include #include @@ -10,7 +11,6 @@ #include #include #include -#include #include #include diff --git a/src/kernel/blockmanager_opts.h b/src/kernel/blockmanager_opts.h index 8f26422f72c3c..f6cfebd5807f9 100644 --- a/src/kernel/blockmanager_opts.h +++ b/src/kernel/blockmanager_opts.h @@ -6,6 +6,7 @@ #define BITCOIN_KERNEL_BLOCKMANAGER_OPTS_H #include +#include #include @@ -25,6 +26,7 @@ struct BlockManagerOpts { bool fast_prune{false}; bool stop_after_block_import{DEFAULT_STOPAFTERBLOCKIMPORT}; const fs::path blocks_dir; + const std::function init_error_callback; }; } // namespace kernel diff --git a/src/kernel/chainstatemanager_opts.h b/src/kernel/chainstatemanager_opts.h index 2395f60164566..6acf6db06f3a7 100644 --- a/src/kernel/chainstatemanager_opts.h +++ b/src/kernel/chainstatemanager_opts.h @@ -15,13 +15,29 @@ #include #include +class CBlockIndex; class CChainParams; +enum class SynchronizationState; static constexpr bool DEFAULT_CHECKPOINTS_ENABLED{true}; static constexpr auto DEFAULT_MAX_TIP_AGE{24h}; namespace kernel { +/** + * A struct containing callback functions to issue notifications from the + * `ChainstateManager`. More ergonomically referred to as + * `ChainstateManager::NotificationCallbacks` due to the using-declaration in + * `ChainstateManager`. + */ +struct ChainstateManagerNotificationCallbacks { + const std::function notify_block_tip; + const std::function notify_header_tip; + const std::function show_progress; + const std::function do_warning; + const std::function init_error; +}; + /** * An options struct for `ChainstateManager`, more ergonomically referred to as * `ChainstateManager::Options` due to the using-declaration in @@ -42,6 +58,8 @@ struct ChainstateManagerOpts { DBOptions block_tree_db{}; DBOptions coins_db{}; CoinsViewOptions coins_view{}; + + const ChainstateManagerNotificationCallbacks notification_callbacks; }; } // namespace kernel diff --git a/src/mapport.cpp b/src/mapport.cpp index 994fd12cf5068..76f8a4d0c9135 100644 --- a/src/mapport.cpp +++ b/src/mapport.cpp @@ -9,12 +9,12 @@ #include #include +#include #include #include #include #include #include -#include #include #include diff --git a/src/net_permissions.cpp b/src/net_permissions.cpp index f829e56aa2806..1e4ec5b529ce8 100644 --- a/src/net_permissions.cpp +++ b/src/net_permissions.cpp @@ -2,10 +2,10 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include #include #include #include -#include #include const std::vector NET_PERMISSIONS_DOC{ diff --git a/src/node/blockstorage.cpp b/src/node/blockstorage.cpp index 65dac459c55b8..bf657ba8cac3b 100644 --- a/src/node/blockstorage.cpp +++ b/src/node/blockstorage.cpp @@ -17,9 +17,9 @@ #include #include #include +#include #include #include -#include #include #include @@ -527,7 +527,7 @@ void BlockManager::FlushUndoFile(int block_file, bool finalize) { FlatFilePos undo_pos_old(block_file, m_blockfile_info[block_file].nUndoSize); if (!UndoFileSeq().Flush(undo_pos_old, finalize)) { - AbortNode("Flushing undo file to disk failed. This is likely the result of an I/O error."); + AbortNode("Flushing undo file to disk failed. This is likely the result of an I/O error.", m_opts.init_error_callback); } } @@ -546,7 +546,7 @@ void BlockManager::FlushBlockFile(bool fFinalize, bool finalize_undo) FlatFilePos block_pos_old(m_last_blockfile, m_blockfile_info[m_last_blockfile].nSize); if (!BlockFileSeq().Flush(block_pos_old, fFinalize)) { - AbortNode("Flushing block file to disk failed. This is likely the result of an I/O error."); + AbortNode("Flushing block file to disk failed. This is likely the result of an I/O error.", m_opts.init_error_callback); } // we do not always flush the undo file, as the chain tip may be lagging behind the incoming blocks, // e.g. during IBD or a sync after a node going offline @@ -658,7 +658,7 @@ bool BlockManager::FindBlockPos(FlatFilePos& pos, unsigned int nAddSize, unsigne bool out_of_space; size_t bytes_allocated = BlockFileSeq().Allocate(pos, nAddSize, out_of_space); if (out_of_space) { - return AbortNode("Disk space is too low!", _("Disk space is too low!")); + return AbortNode("Disk space is too low!", m_opts.init_error_callback, _("Disk space is too low!")); } if (bytes_allocated != 0 && IsPruneMode()) { m_check_for_pruning = true; @@ -682,7 +682,7 @@ bool BlockManager::FindUndoPos(BlockValidationState& state, int nFile, FlatFileP bool out_of_space; size_t bytes_allocated = UndoFileSeq().Allocate(pos, nAddSize, out_of_space); if (out_of_space) { - return AbortNode(state, "Disk space is too low!", _("Disk space is too low!")); + return AbortNode(state, "Disk space is too low!", m_opts.init_error_callback, _("Disk space is too low!")); } if (bytes_allocated != 0 && IsPruneMode()) { m_check_for_pruning = true; @@ -724,7 +724,7 @@ bool BlockManager::WriteUndoDataForBlock(const CBlockUndo& blockundo, BlockValid return error("ConnectBlock(): FindUndoPos failed"); } if (!UndoWriteToDisk(blockundo, _pos, block.pprev->GetBlockHash(), GetParams().MessageStart())) { - return AbortNode(state, "Failed to write undo data"); + return AbortNode(state, "Failed to write undo data", m_opts.init_error_callback); } // rev files are written in block height order, whereas blk files are written as blocks come in (often out of order) // we want to flush the rev (undo) file once we've written the last block, which is indicated by the last height @@ -842,7 +842,7 @@ FlatFilePos BlockManager::SaveBlockToDisk(const CBlock& block, int nHeight, CCha } if (!position_known) { if (!WriteBlockToDisk(block, blockPos, GetParams().MessageStart())) { - AbortNode("Failed to write block"); + AbortNode("Failed to write block", m_opts.init_error_callback); return FlatFilePos(); } } diff --git a/src/node/blockstorage.h b/src/node/blockstorage.h index bce071c7df863..3eaf5a07b838c 100644 --- a/src/node/blockstorage.h +++ b/src/node/blockstorage.h @@ -154,7 +154,10 @@ class BlockManager explicit BlockManager(Options opts) : m_prune_mode{opts.prune_target > 0}, - m_opts{std::move(opts)} {}; + m_opts{std::move(opts)} + { + assert(m_opts.init_error_callback); + }; std::atomic m_importing{false}; diff --git a/src/node/chainstate.cpp b/src/node/chainstate.cpp index 40b609d0691a4..94f0d83b91f74 100644 --- a/src/node/chainstate.cpp +++ b/src/node/chainstate.cpp @@ -200,14 +200,17 @@ ChainstateLoadResult LoadChainstate(ChainstateManager& chainman, const CacheSize // snapshot is actually validated? Because this entails unusual // filesystem operations to move leveldb data directories around, and that seems // too risky to do in the middle of normal runtime. - auto snapshot_completion = chainman.MaybeCompleteSnapshotValidation(); + auto snapshot_completion = chainman.MaybeCompleteSnapshotValidation( + [&init_error = chainman.GetInitErrorCb()](bilingual_str msg) { + AbortNode(msg.original, init_error, msg); + }); if (snapshot_completion == SnapshotCompletionResult::SKIPPED) { // do nothing; expected case } else if (snapshot_completion == SnapshotCompletionResult::SUCCESS) { LogPrintf("[snapshot] cleaning up unneeded background chainstate, then reinitializing\n"); if (!chainman.ValidatedSnapshotCleanup()) { - AbortNode("Background chainstate cleanup failed unexpectedly."); + AbortNode("Background chainstate cleanup failed unexpectedly.", chainman.GetInitErrorCb()); } // Because ValidatedSnapshotCleanup() has torn down chainstates with @@ -253,10 +256,7 @@ ChainstateLoadResult VerifyLoadedChainstate(ChainstateManager& chainman, const C "Only rebuild the block database if you are sure that your computer's date and time are correct")}; } - VerifyDBResult result = CVerifyDB().VerifyDB( - *chainstate, chainman.GetConsensus(), chainstate->CoinsDB(), - options.check_level, - options.check_blocks); + VerifyDBResult result = CVerifyDB(chainman.GetShowProgressCb()).VerifyDB(*chainstate, chainman.GetConsensus(), chainstate->CoinsDB(), options.check_level, options.check_blocks); switch (result) { case VerifyDBResult::SUCCESS: case VerifyDBResult::SKIPPED_MISSING_BLOCKS: diff --git a/src/node/chainstatemanager_notifications.cpp b/src/node/chainstatemanager_notifications.cpp new file mode 100644 index 0000000000000..af5e09152a387 --- /dev/null +++ b/src/node/chainstatemanager_notifications.cpp @@ -0,0 +1,71 @@ +// Copyright (c) 2023 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include + +#if defined(HAVE_CONFIG_H) +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +using kernel::ChainstateManagerNotificationCallbacks; + +class CBlockIndex; + +namespace node { + +static void AlertNotify(const std::string& strMessage) +{ + uiInterface.NotifyAlertChanged(); +#if HAVE_SYSTEM + std::string strCmd = gArgs.GetArg("-alertnotify", ""); + if (strCmd.empty()) return; + + // Alert text should be plain ascii coming from a trusted source, but to + // be safe we first strip anything not in safeChars, then add single quotes around + // the whole string before passing it to the shell: + std::string singleQuote("'"); + std::string safeStatus = SanitizeString(strMessage); + safeStatus = singleQuote+safeStatus+singleQuote; + ReplaceAll(strCmd, "%s", safeStatus); + + std::thread t(runCommand, strCmd); + t.detach(); // thread runs free +#endif +} + +static void DoWarning(const bilingual_str& warning) +{ + static bool fWarned = false; + SetMiscWarning(warning); + if (!fWarned) { + AlertNotify(warning.original); + fWarned = true; + } +} + +ChainstateManagerNotificationCallbacks DefaultChainstateManagerNotifications() +{ + return ChainstateManagerNotificationCallbacks{ + .notify_block_tip = [](SynchronizationState state, CBlockIndex* index) { uiInterface.NotifyBlockTip(state, index); }, + .notify_header_tip = [](SynchronizationState state, int64_t height, int64_t timestamp, bool presync) { uiInterface.NotifyHeaderTip(state, height, timestamp, presync); }, + .show_progress = [](const std::string& title, int nProgress, bool resume_possible) { uiInterface.ShowProgress(title, nProgress, resume_possible); }, + .do_warning = [](const bilingual_str& warning) { DoWarning(warning); }, + .init_error = [](const bilingual_str& user_message) { InitError(user_message); }, + }; +} +} // namespace node diff --git a/src/node/chainstatemanager_notifications.h b/src/node/chainstatemanager_notifications.h new file mode 100644 index 0000000000000..ad943bb6cb9df --- /dev/null +++ b/src/node/chainstatemanager_notifications.h @@ -0,0 +1,14 @@ +// Copyright (c) 2023 The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#ifndef BITCOIN_NODE_CHAINSTATEMANAGER_NOTIFICATIONS_H +#define BITCOIN_NODE_CHAINSTATEMANAGER_NOTIFICATIONS_H + +#include + +namespace node { +kernel::ChainstateManagerNotificationCallbacks DefaultChainstateManagerNotifications(); +} // namespace node + +#endif // BITCOIN_NODE_CHAINSTATEMANAGER_NOTIFICATIONS_H diff --git a/src/node/txreconciliation.cpp b/src/node/txreconciliation.cpp index 993875907432d..d62046daaaa65 100644 --- a/src/node/txreconciliation.cpp +++ b/src/node/txreconciliation.cpp @@ -4,9 +4,9 @@ #include +#include #include #include -#include #include #include diff --git a/src/policy/fees.cpp b/src/policy/fees.cpp index 6121224979b04..ae226f7011470 100644 --- a/src/policy/fees.cpp +++ b/src/policy/fees.cpp @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -19,7 +20,6 @@ #include #include #include -#include #include #include diff --git a/src/protocol.cpp b/src/protocol.cpp index 5725813b7e58a..5ecaabec36710 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -5,7 +5,7 @@ #include -#include +#include #include diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index d602d2c1ac25a..e33753f5e77cb 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -32,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index d26ef52eb4315..855fcff002249 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -30,13 +30,13 @@ #include #endif -#include #include #include +#include +#include #include #include #include -#include #include #include diff --git a/src/qt/clientmodel.cpp b/src/qt/clientmodel.cpp index b22f1bc35c809..ff7405d1395af 100644 --- a/src/qt/clientmodel.cpp +++ b/src/qt/clientmodel.cpp @@ -12,11 +12,11 @@ #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp index 6dec4b2e42e54..f23e025387b20 100644 --- a/src/qt/optionsdialog.cpp +++ b/src/qt/optionsdialog.cpp @@ -15,11 +15,11 @@ #include #include +#include #include -#include // for DEFAULT_SCRIPTCHECK_THREADS and MAX_SCRIPTCHECK_THREADS #include -#include // for -dbcache defaults -#include +#include // for -dbcache defaults +#include // for DEFAULT_SCRIPTCHECK_THREADS and MAX_SCRIPTCHECK_THREADS #include diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index bac64e3d5f61e..90aae0219eead 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -21,7 +22,6 @@ #include #include #include -#include #include #include diff --git a/src/qt/splashscreen.cpp b/src/qt/splashscreen.cpp index 096f8a0dedcf1..8872f8be321ce 100644 --- a/src/qt/splashscreen.cpp +++ b/src/qt/splashscreen.cpp @@ -9,13 +9,13 @@ #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/src/qt/test/rpcnestedtests.cpp b/src/qt/test/rpcnestedtests.cpp index 669a05fe0f2e9..72e80554255a1 100644 --- a/src/qt/test/rpcnestedtests.cpp +++ b/src/qt/test/rpcnestedtests.cpp @@ -4,12 +4,12 @@ #include +#include #include -#include #include +#include #include #include -#include #include diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index 2461a0693071b..fa110cfbc9bae 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -13,12 +13,12 @@ #include #include +#include #include #include #include #include #include -#include #include #include diff --git a/src/rest.cpp b/src/rest.cpp index dae064f89d52d..7e0478809265a 100644 --- a/src/rest.cpp +++ b/src/rest.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -25,7 +26,6 @@ #include #include #include -#include #include #include diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp index 72866532d2a4c..3cd22b694a8e5 100644 --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -1123,8 +1123,7 @@ static RPCHelpMan verifychain() LOCK(cs_main); Chainstate& active_chainstate = chainman.ActiveChainstate(); - return CVerifyDB().VerifyDB( - active_chainstate, chainman.GetParams().GetConsensus(), active_chainstate.CoinsTip(), check_level, check_depth) == VerifyDBResult::SUCCESS; + return CVerifyDB(chainman.GetShowProgressCb()).VerifyDB(active_chainstate, chainman.GetParams().GetConsensus(), active_chainstate.CoinsTip(), check_level, check_depth) == VerifyDBResult::SUCCESS; }, }; } diff --git a/src/rpc/external_signer.cpp b/src/rpc/external_signer.cpp index ac135ba216a3e..310eec5f15ea5 100644 --- a/src/rpc/external_signer.cpp +++ b/src/rpc/external_signer.cpp @@ -3,12 +3,12 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include +#include #include #include #include #include #include -#include #include #include diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp index 68017e5af2539..eb61d58a33684 100644 --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -32,7 +33,6 @@ #include #include #include -#include #include #include #include diff --git a/src/rpc/node.cpp b/src/rpc/node.cpp index 5918bc6e38353..730cc69bad276 100644 --- a/src/rpc/node.cpp +++ b/src/rpc/node.cpp @@ -4,6 +4,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include +#include #include #include #include @@ -21,7 +22,6 @@ #include #include #include -#include #include #ifdef HAVE_MALLOC_INFO diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp index 354f949002464..474b318c66b44 100644 --- a/src/rpc/server.cpp +++ b/src/rpc/server.cpp @@ -6,13 +6,13 @@ #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/src/rpc/server_util.cpp b/src/rpc/server_util.cpp index 13d007b4962db..96e2d9df160d1 100644 --- a/src/rpc/server_util.cpp +++ b/src/rpc/server_util.cpp @@ -5,13 +5,13 @@ #include #include +#include #include #include #include #include #include #include -#include #include #include diff --git a/src/script/sigcache.cpp b/src/script/sigcache.cpp index e52e8cd30907e..7c6c282cc470d 100644 --- a/src/script/sigcache.cpp +++ b/src/script/sigcache.cpp @@ -5,11 +5,11 @@ #include