diff options
author | furszy <matiasfurszyfer@protonmail.com> | 2023-06-16 20:42:01 -0300 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2023-06-16 21:00:20 -0300 |
commit | a72af2e833bcf7baa79a246609da90ae0ade2a82 (patch) | |
tree | 020cbb31ddb353f00a628f22276b1e38d788d601 /src/bench/wallet_create_tx.cpp | |
parent | f0758d8a6696657269d9c057e7aa079ffa9e1c16 (diff) |
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.
Diffstat (limited to 'src/bench/wallet_create_tx.cpp')
-rw-r--r-- | src/bench/wallet_create_tx.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bench/wallet_create_tx.cpp b/src/bench/wallet_create_tx.cpp index 13b0019fd2..5e5bc76fd2 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<const TestingSetup>(); + // 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<OutputType>& output_type) { const auto test_setup = MakeNoLogFileContext<const TestingSetup>(); + // 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); |