diff --git a/src/bench/util_time.cpp b/src/bench/util_time.cpp index bc3e3892f1f..19ffd0e0498 100644 --- a/src/bench/util_time.cpp +++ b/src/bench/util_time.cpp @@ -3,7 +3,7 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include - +#include #include static void BenchTimeDeprecated(benchmark::Bench& bench) @@ -15,11 +15,10 @@ static void BenchTimeDeprecated(benchmark::Bench& bench) static void BenchTimeMock(benchmark::Bench& bench) { - SetMockTime(111); + NodeClockContext clock_ctx{111s}; bench.run([&] { (void)GetTime(); }); - SetMockTime(0); } static void BenchTimeMillis(benchmark::Bench& bench) diff --git a/src/bench/wallet_balance.cpp b/src/bench/wallet_balance.cpp index 03774ef54ac..45f23494280 100644 --- a/src/bench/wallet_balance.cpp +++ b/src/bench/wallet_balance.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -32,7 +33,7 @@ static void WalletBalance(benchmark::Bench& bench, const bool set_dirty, const b // Set clock to genesis block, so the descriptors/keys creation time don't interfere with the blocks scanning process. // The reason is 'generatetoaddress', which creates a chain with deterministic timestamps in the past. - SetMockTime(test_setup->m_node.chainman->GetParams().GenesisBlock().nTime); + NodeClockContext clock_ctx{test_setup->m_node.chainman->GetParams().GenesisBlock().Time()}; CWallet wallet{test_setup->m_node.chain.get(), "", CreateMockableWalletDatabase()}; { LOCK(wallet.cs_wallet); diff --git a/src/bench/wallet_create_tx.cpp b/src/bench/wallet_create_tx.cpp index 8ff1e39a2f8..11125e26fed 100644 --- a/src/bench/wallet_create_tx.cpp +++ b/src/bench/wallet_create_tx.cpp @@ -20,6 +20,7 @@ #include