mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-24 22:45:41 +01:00
Merge bitcoin/bitcoin#27907: bench: bugfix, disable birth time block skip for wallet_create_tx.cpp
a72af2e833bench: disable birth time block skip for wallet_create_tx.cpp (furszy) Pull request description: 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 birth time to the genesis block time. So the wallet is always older than any new block. ACKs for top commit: achow101: ACKa72af2e833hernanmarino: ACKa72af2e833TheCharlatan: ACKa72af2e833Tree-SHA512: d3148659bd633d20978736e1292e3456a2c6dd2b6c8f60625a4160e16818d923487c889237eb3f34693f7dd78b7d124b89afdc56e4c9fad370026d0733ef1e08
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user