From a10f032115644d60a4321af06768d87d625affc1 Mon Sep 17 00:00:00 2001 From: furszy Date: Tue, 30 May 2023 17:44:10 -0300 Subject: 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. --- src/wallet/test/fuzz/notifications.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/wallet/test/fuzz/notifications.cpp b/src/wallet/test/fuzz/notifications.cpp index de381a5ec9..f4b69f7403 100644 --- a/src/wallet/test/fuzz/notifications.cpp +++ b/src/wallet/test/fuzz/notifications.cpp @@ -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::max(); a.wallet->blockConnected(info); b.wallet->blockConnected(info); // Store the coins for the next block -- cgit v1.2.3