mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-19 21:31:33 +02:00
node/chainstate: Decouple from GetTimeMillis
...instead just move it out
This commit is contained in:
parent
cb64af9635
commit
cbac28b72f
@ -1419,6 +1419,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||||||
|
|
||||||
uiInterface.InitMessage(_("Loading block index…").translated);
|
uiInterface.InitMessage(_("Loading block index…").translated);
|
||||||
|
|
||||||
|
const int64_t load_block_index_start_time = GetTimeMillis();
|
||||||
bool rv = LoadChainstate(fLoaded,
|
bool rv = LoadChainstate(fLoaded,
|
||||||
strLoadError,
|
strLoadError,
|
||||||
fReset,
|
fReset,
|
||||||
@ -1432,6 +1433,9 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||||||
nCoinDBCache,
|
nCoinDBCache,
|
||||||
nCoinCacheUsage);
|
nCoinCacheUsage);
|
||||||
if (!rv) return false;
|
if (!rv) return false;
|
||||||
|
if (fLoaded) {
|
||||||
|
LogPrintf(" block index %15dms\n", GetTimeMillis() - load_block_index_start_time);
|
||||||
|
}
|
||||||
|
|
||||||
if (!fLoaded && !ShutdownRequested()) {
|
if (!fLoaded && !ShutdownRequested()) {
|
||||||
// first suggest a reindex
|
// first suggest a reindex
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include <chainparams.h> // for CChainParams
|
#include <chainparams.h> // for CChainParams
|
||||||
#include <rpc/blockchain.h> // for RPCNotifyBlockChange
|
#include <rpc/blockchain.h> // for RPCNotifyBlockChange
|
||||||
#include <util/time.h> // for GetTime, GetTimeMillis
|
#include <util/time.h> // for GetTime
|
||||||
#include <util/translation.h> // for bilingual_str
|
#include <util/translation.h> // for bilingual_str
|
||||||
#include <node/blockstorage.h> // for CleanupBlockRevFiles, fHavePruned, fReindex
|
#include <node/blockstorage.h> // for CleanupBlockRevFiles, fHavePruned, fReindex
|
||||||
#include <node/context.h> // for NodeContext
|
#include <node/context.h> // for NodeContext
|
||||||
@ -31,7 +31,6 @@ bool LoadChainstate(bool& fLoaded,
|
|||||||
};
|
};
|
||||||
|
|
||||||
do {
|
do {
|
||||||
const int64_t load_block_index_start_time = GetTimeMillis();
|
|
||||||
try {
|
try {
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
chainman.InitializeChainstate(Assert(node.mempool.get()));
|
chainman.InitializeChainstate(Assert(node.mempool.get()));
|
||||||
@ -197,7 +196,6 @@ bool LoadChainstate(bool& fLoaded,
|
|||||||
|
|
||||||
if (!failed_verification) {
|
if (!failed_verification) {
|
||||||
fLoaded = true;
|
fLoaded = true;
|
||||||
LogPrintf(" block index %15dms\n", GetTimeMillis() - load_block_index_start_time);
|
|
||||||
}
|
}
|
||||||
} while(false);
|
} while(false);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user