Skip to content

Commit 1b8b28d

Browse files
committed
Merge bitcoin/bitcoin#27786: fuzz: fix wallet notifications.cpp
a10f032 fuzz: fix wallet notifications.cpp (furszy) Pull request description: Fixing bitcoin/bitcoin#27469 (comment). As the fuzzing 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 by the wallet. ACKs for top commit: MarcoFalke: lgtm ACK a10f032, thanks Tree-SHA512: c9b38c52917cc36674415470752625b8161fc6b878b0b87d6926b462ba9666be3c225d396604c7e944a4c268fc35fc624807777aa0ed94bddbe18d8f8436de3c
2 parents 433f17b + a10f032 commit 1b8b28d

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)