mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-14 12:43:40 +02:00
Do not pass time getter to Chainstate helpers
This commit is contained in:
parent
002411dc53
commit
fa4ee53dca
5 changed files with 6 additions and 11 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue