Skip to content

Commit a10f032

Browse files
committed
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.
1 parent 7130048 commit a10f032

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/wallet/test/fuzz/notifications.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ FUZZ_TARGET_INIT(wallet_notifications, initialize_setup)
141141
info.prev_hash = &block.hashPrevBlock;
142142
info.height = chain.size();
143143
info.data = █
144+
// Ensure that no blocks are skipped by the wallet by setting the chain's accumulated
145+
// time to the maximum value. This ensures that the wallet's birth time is always
146+
// earlier than this maximum time.
147+
info.chain_time_max = std::numeric_limits<unsigned int>::max();
144148
a.wallet->blockConnected(info);
145149
b.wallet->blockConnected(info);
146150
// Store the coins for the next block

0 commit comments

Comments
 (0)