mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
refactor: Remove call to ShutdownRequested from chainstate init
Use chainman.m_interrupt object instead There is no change in behavior in this commit
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include <txdb.h>
|
||||
#include <uint256.h>
|
||||
#include <util/fs.h>
|
||||
#include <util/signalinterrupt.h>
|
||||
#include <util/time.h>
|
||||
#include <util/translation.h>
|
||||
#include <validation.h>
|
||||
@@ -55,14 +56,14 @@ static ChainstateLoadResult CompleteChainstateInitialization(
|
||||
}
|
||||
}
|
||||
|
||||
if (options.check_interrupt && options.check_interrupt()) return {ChainstateLoadStatus::INTERRUPTED, {}};
|
||||
if (chainman.m_interrupt) return {ChainstateLoadStatus::INTERRUPTED, {}};
|
||||
|
||||
// LoadBlockIndex will load m_have_pruned if we've ever removed a
|
||||
// block file from disk.
|
||||
// Note that it also sets fReindex global based on the disk flag!
|
||||
// From here on, fReindex and options.reindex values may be different!
|
||||
if (!chainman.LoadBlockIndex()) {
|
||||
if (options.check_interrupt && options.check_interrupt()) return {ChainstateLoadStatus::INTERRUPTED, {}};
|
||||
if (chainman.m_interrupt) return {ChainstateLoadStatus::INTERRUPTED, {}};
|
||||
return {ChainstateLoadStatus::FAILURE, _("Error loading block database")};
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ struct ChainstateLoadOptions {
|
||||
bool require_full_verification{true};
|
||||
int64_t check_blocks{DEFAULT_CHECKBLOCKS};
|
||||
int64_t check_level{DEFAULT_CHECKLEVEL};
|
||||
std::function<bool()> check_interrupt;
|
||||
std::function<void()> coins_error_cb;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user