mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Merge e253568da8 into merged_master (Bitcoin PR bitcoin/bitcoin#28053)
This commit is contained in:
commit
61ecd1fa45
5 changed files with 7 additions and 13 deletions
|
|
@ -118,7 +118,6 @@
|
|||
#include <zmq/zmqrpc.h>
|
||||
#endif
|
||||
|
||||
using kernel::DEFAULT_STOPAFTERBLOCKIMPORT;
|
||||
using kernel::DumpMempool;
|
||||
using kernel::ValidationCacheSizes;
|
||||
|
||||
|
|
@ -140,6 +139,7 @@ using node::VerifyLoadedChainstate;
|
|||
static constexpr bool DEFAULT_PROXYRANDOMIZE{true};
|
||||
static constexpr bool DEFAULT_REST_ENABLE{false};
|
||||
static constexpr bool DEFAULT_I2P_ACCEPT_INCOMING{true};
|
||||
static constexpr bool DEFAULT_STOPAFTERBLOCKIMPORT{false};
|
||||
|
||||
#ifdef WIN32
|
||||
// Win32 LevelDB doesn't use filedescriptors, and the ones used for
|
||||
|
|
@ -1795,6 +1795,12 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
chainman.m_thread_load = std::thread(&util::TraceThread, "initload", [=, &chainman, &args, &node] {
|
||||
// Import blocks
|
||||
ImportBlocks(chainman, vImportFiles);
|
||||
if (args.GetBoolArg("-stopafterblockimport", DEFAULT_STOPAFTERBLOCKIMPORT)) {
|
||||
LogPrintf("Stopping after block import\n");
|
||||
StartShutdown();
|
||||
return;
|
||||
}
|
||||
|
||||
// Start indexes initial sync
|
||||
if (!StartIndexBackgroundSync(node)) {
|
||||
bilingual_str err_str = _("Failed to start indexes, shutting down..");
|
||||
|
|
|
|||
|
|
@ -14,8 +14,6 @@ class CChainParams;
|
|||
|
||||
namespace kernel {
|
||||
|
||||
static constexpr bool DEFAULT_STOPAFTERBLOCKIMPORT{false};
|
||||
|
||||
/**
|
||||
* An options struct for `BlockManager`, more ergonomically referred to as
|
||||
* `BlockManager::Options` due to the using-declaration in `BlockManager`.
|
||||
|
|
@ -24,7 +22,6 @@ struct BlockManagerOpts {
|
|||
const CChainParams& chainparams;
|
||||
uint64_t prune_target{0};
|
||||
bool fast_prune{false};
|
||||
bool stop_after_block_import{DEFAULT_STOPAFTERBLOCKIMPORT};
|
||||
const fs::path blocks_dir;
|
||||
Notifications& notifications;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ util::Result<void> ApplyArgsManOptions(const ArgsManager& args, BlockManager::Op
|
|||
opts.prune_target = nPruneTarget;
|
||||
|
||||
if (auto value{args.GetBoolArg("-fastprune")}) opts.fast_prune = *value;
|
||||
if (auto value{args.GetBoolArg("-stopafterblockimport")}) opts.stop_after_block_import = *value;
|
||||
|
||||
return {};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -958,12 +958,6 @@ void ImportBlocks(ChainstateManager& chainman, std::vector<fs::path> vImportFile
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (chainman.m_blockman.StopAfterBlockImport()) {
|
||||
LogPrintf("Stopping after block import\n");
|
||||
StartShutdown();
|
||||
return;
|
||||
}
|
||||
} // End scope of ImportingNow
|
||||
}
|
||||
} // namespace node
|
||||
|
|
|
|||
|
|
@ -223,8 +223,6 @@ public:
|
|||
|
||||
[[nodiscard]] bool LoadingBlocks() const { return m_importing || fReindex; }
|
||||
|
||||
[[nodiscard]] bool StopAfterBlockImport() const { return m_opts.stop_after_block_import; }
|
||||
|
||||
/** Calculate the amount of disk space the block & undo files currently use */
|
||||
uint64_t CalculateCurrentUsage();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue