mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-24 22:45:41 +01:00
refactor: Move stopafterblockimport handling out of blockstorage
This has the benefit of moving the StartShutdown call out of the blockstorage file and thus out of the kernel's responsibility. The user can now decide if he wants to start shutdown / interrupt after a block import or not.
This commit is contained in:
committed by
Sebastian Kung
parent
ef29d5d7e2
commit
462390c85f
@@ -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 {};
|
||||
}
|
||||
|
||||
@@ -946,12 +946,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
|
||||
|
||||
@@ -213,8 +213,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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user