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.
This commit is contained in:
Carl Dong
2021-09-22 15:36:10 -04:00
parent 2414ebc18b
commit 05441c2dc5
3 changed files with 7 additions and 5 deletions

View File

@@ -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;