node/chainstate: Decouple from GetTime
Summary:
...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.
Partial backport of core#23280:
https://github.com/bitcoin/bitcoin/pull/23280/commits/05441c2dc5f60e2025476d8ec94c9025032d118c
Depends on D12576.
Test Plan:
ninja all check-all
Reviewers: #bitcoin_abc, sdulfari
Reviewed By: #bitcoin_abc, sdulfari
Differential Revision: https://reviews.bitcoinabc.org/D12577