aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorCarl Dong <contact@carldong.me>2021-09-22 15:36:10 -0400
committerCarl Dong <contact@carldong.me>2021-12-07 14:48:49 -0500
commit05441c2dc5f60e2025476d8ec94c9025032d118c (patch)
tree50585cd5303a9adb3af83dfc73a2e6405400f396 /src/init.cpp
parent2414ebc18b8bebf79c47e58a4293d0fc6420a811 (diff)
downloadbitcoin-05441c2dc5f60e2025476d8ec94c9025032d118c.tar.xz
node/chainstate: Decouple from GetTime
...instead pass in a std::function<int64_t()> Note that the static_cast is needed (apparently) for the compiler to know which overloaded GetTime to choose.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 9c8963d10d..5df4d794f3 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1487,7 +1487,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
fReindexChainState,
chainparams,
check_blocks,
- args.GetIntArg("-checklevel", DEFAULT_CHECKLEVEL));
+ args.GetIntArg("-checklevel", DEFAULT_CHECKLEVEL),
+ static_cast<int64_t(*)()>(GetTime));
} catch (const std::exception& e) {
LogPrintf("%s\n", e.what());
rv2 = ChainstateLoadVerifyError::ERROR_GENERIC_FAILURE;