0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-09 10:43:19 -05:00

fuzz: fix wallet notifications.cpp

As the fuzzer test requires all blocks to be
scanned by the wallet (because it is asserting
the wallet balance at the end), we need to
ensure that no blocks are skipped by the recently
added wallet birth time functionality.

This just means setting the chain accumulated time
to the maximum value, so the wallet birth time is
always below it, and the block is always processed.
This commit is contained in:
furszy 2023-05-30 17:44:10 -03:00
parent 71300489af
commit a10f032115
No known key found for this signature in database
GPG key ID: 5DD23CCC686AA623

View file

@ -141,6 +141,10 @@ FUZZ_TARGET_INIT(wallet_notifications, initialize_setup)
info.prev_hash = &block.hashPrevBlock;
info.height = chain.size();
info.data = █
// Ensure that no blocks are skipped by the wallet by setting the chain's accumulated
// time to the maximum value. This ensures that the wallet's birth time is always
// earlier than this maximum time.
info.chain_time_max = std::numeric_limits<unsigned int>::max();
a.wallet->blockConnected(info);
b.wallet->blockConnected(info);
// Store the coins for the next block