aboutsummaryrefslogtreecommitdiff
path: root/src/node
diff options
context:
space:
mode:
authorMacroFake <falke.marco@gmail.com>2022-05-18 18:31:19 +0200
committerMacroFake <falke.marco@gmail.com>2022-05-18 18:44:04 +0200
commitfa4ee53dca5ccf1b87f019f372ffc10528add943 (patch)
tree4ca3b355f22078aebc9cb08cac03df96cc2e90b1 /src/node
parent002411dc53753b52fef645484258e8baf41585a1 (diff)
downloadbitcoin-fa4ee53dca5ccf1b87f019f372ffc10528add943.tar.xz
Do not pass time getter to Chainstate helpers
Diffstat (limited to 'src/node')
-rw-r--r--src/node/chainstate.cpp5
-rw-r--r--src/node/chainstate.h3
2 files changed, 3 insertions, 5 deletions
diff --git a/src/node/chainstate.cpp b/src/node/chainstate.cpp
index 99615dea69..309c5f8f37 100644
--- a/src/node/chainstate.cpp
+++ b/src/node/chainstate.cpp
@@ -128,8 +128,7 @@ std::optional<ChainstateLoadVerifyError> VerifyLoadedChainstate(ChainstateManage
bool fReindexChainState,
const Consensus::Params& consensus_params,
int check_blocks,
- int check_level,
- std::function<int64_t()> get_unix_time_seconds)
+ int check_level)
{
auto is_coinsview_empty = [&](CChainState* chainstate) EXCLUSIVE_LOCKS_REQUIRED(::cs_main) {
return fReset || fReindexChainState || chainstate->CoinsTip().GetBestBlock().IsNull();
@@ -140,7 +139,7 @@ std::optional<ChainstateLoadVerifyError> VerifyLoadedChainstate(ChainstateManage
for (CChainState* chainstate : chainman.GetAll()) {
if (!is_coinsview_empty(chainstate)) {
const CBlockIndex* tip = chainstate->m_chain.Tip();
- if (tip && tip->nTime > get_unix_time_seconds() + MAX_FUTURE_BLOCK_TIME) {
+ if (tip && tip->nTime > GetTime() + MAX_FUTURE_BLOCK_TIME) {
return ChainstateLoadVerifyError::ERROR_BLOCK_FROM_FUTURE;
}
diff --git a/src/node/chainstate.h b/src/node/chainstate.h
index 8ba04f1436..deeca5db06 100644
--- a/src/node/chainstate.h
+++ b/src/node/chainstate.h
@@ -80,8 +80,7 @@ std::optional<ChainstateLoadVerifyError> VerifyLoadedChainstate(ChainstateManage
bool fReindexChainState,
const Consensus::Params& consensus_params,
int check_blocks,
- int check_level,
- std::function<int64_t()> get_unix_time_seconds);
+ int check_level);
} // namespace node
#endif // BITCOIN_NODE_CHAINSTATE_H