Merge bitcoin/bitcoin#25786: refactor: Make adjusted time type safe

eeee5ada23 Make adjusted time type safe (MacroFake)
fa3be799fe Add time helpers (MacroFake)

Pull request description:

  This makes follow-ups easier to review. Also, it makes sense by itself.

ACKs for top commit:
  ryanofsky:
    Code review ACK eeee5ada23. Confirmed type changes and equivalent code changes only.

Tree-SHA512: 51bf1ae5428552177286113babdd49e82459d6c710a07b6e80a0a045d373cf51045ee010461aba98e0151d8d71b9b3b5f8f73e302d46ba4558e0b55201f99e9f
This commit is contained in:
fanquake
2022-08-22 09:56:23 +01:00
11 changed files with 36 additions and 16 deletions

View File

@@ -336,7 +336,7 @@ bool TestBlockValidity(BlockValidationState& state,
CChainState& chainstate,
const CBlock& block,
CBlockIndex* pindexPrev,
const std::function<int64_t()>& adjusted_time_callback,
const std::function<NodeClock::time_point()>& adjusted_time_callback,
bool fCheckPOW = true,
bool fCheckMerkleRoot = true) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
@@ -840,7 +840,7 @@ private:
const CChainParams m_chainparams;
const std::function<int64_t()> m_adjusted_time_callback;
const std::function<NodeClock::time_point()> m_adjusted_time_callback;
//! Internal helper for ActivateSnapshot().
[[nodiscard]] bool PopulateAndValidateSnapshot(