From a72af2e833bcf7baa79a246609da90ae0ade2a82 Mon Sep 17 00:00:00 2001 From: furszy Date: Fri, 16 Jun 2023 20:42:01 -0300 Subject: [PATCH] bench: disable birth time block skip for wallet_create_tx.cpp As the benchmarks inside wallet_create_tx.cpp assert the wallet balance at the end, they require all blocks to be scanned by the wallet. So, we need to ensure that no blocks are skipped by the recently added wallet birth time functionality. This just means setting the wallet birthtime to the genesis block time. So the wallet is always older than any new block. --- src/bench/wallet_create_tx.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bench/wallet_create_tx.cpp b/src/bench/wallet_create_tx.cpp index 13b0019fd2f..5e5bc76fd21 100644 --- a/src/bench/wallet_create_tx.cpp +++ b/src/bench/wallet_create_tx.cpp @@ -83,6 +83,8 @@ static void WalletCreateTx(benchmark::Bench& bench, const OutputType output_type { const auto test_setup = MakeNoLogFileContext(); + // Set clock to genesis block, so the descriptors/keys creation time don't interfere with the blocks scanning process. + SetMockTime(test_setup->m_node.chainman->GetParams().GenesisBlock().nTime); CWallet wallet{test_setup->m_node.chain.get(), "", CreateMockableWalletDatabase()}; { LOCK(wallet.cs_wallet); @@ -136,6 +138,8 @@ static void WalletCreateTx(benchmark::Bench& bench, const OutputType output_type static void AvailableCoins(benchmark::Bench& bench, const std::vector& output_type) { const auto test_setup = MakeNoLogFileContext(); + // Set clock to genesis block, so the descriptors/keys creation time don't interfere with the blocks scanning process. + SetMockTime(test_setup->m_node.chainman->GetParams().GenesisBlock().nTime); CWallet wallet{test_setup->m_node.chain.get(), "", CreateMockableWalletDatabase()}; { LOCK(wallet.cs_wallet);