mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05:00
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.
This commit is contained in:
parent
f0758d8a66
commit
a72af2e833
1 changed files with 4 additions and 0 deletions
|
@ -83,6 +83,8 @@ static void WalletCreateTx(benchmark::Bench& bench, const OutputType output_type
|
||||||
{
|
{
|
||||||
const auto test_setup = MakeNoLogFileContext<const TestingSetup>();
|
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()};
|
CWallet wallet{test_setup->m_node.chain.get(), "", CreateMockableWalletDatabase()};
|
||||||
{
|
{
|
||||||
LOCK(wallet.cs_wallet);
|
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)
|
static void AvailableCoins(benchmark::Bench& bench, const std::vector<OutputType>& output_type)
|
||||||
{
|
{
|
||||||
const auto test_setup = MakeNoLogFileContext<const TestingSetup>();
|
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()};
|
CWallet wallet{test_setup->m_node.chain.get(), "", CreateMockableWalletDatabase()};
|
||||||
{
|
{
|
||||||
LOCK(wallet.cs_wallet);
|
LOCK(wallet.cs_wallet);
|
||||||
|
|
Loading…
Add table
Reference in a new issue