diff options
author | furszy <matiasfurszyfer@protonmail.com> | 2023-05-30 17:44:10 -0300 |
---|---|---|
committer | furszy <matiasfurszyfer@protonmail.com> | 2023-05-30 17:46:46 -0300 |
commit | a10f032115644d60a4321af06768d87d625affc1 (patch) | |
tree | 96058c76b9ddbd3ccf68e77a9553b1807bead5d1 | |
parent | 71300489af362c3fed4736de6bffab4d758b6a84 (diff) | |
download | bitcoin-a10f032115644d60a4321af06768d87d625affc1.tar.xz |
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.
-rw-r--r-- | src/wallet/test/fuzz/notifications.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
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<unsigned int>::max(); a.wallet->blockConnected(info); b.wallet->blockConnected(info); // Store the coins for the next block |