0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-05 14:06:27 -05:00

Merge bitcoin/bitcoin#27786: fuzz: fix wallet notifications.cpp

a10f032115 fuzz: fix wallet notifications.cpp (furszy)

Pull request description:

  Fixing https://github.com/bitcoin/bitcoin/pull/27469#issuecomment-1568815816.

  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 a10f032115, thanks

Tree-SHA512: c9b38c52917cc36674415470752625b8161fc6b878b0b87d6926b462ba9666be3c225d396604c7e944a4c268fc35fc624807777aa0ed94bddbe18d8f8436de3c
This commit is contained in:
fanquake 2023-05-31 10:53:20 +01:00
commit 1b8b28d83b
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

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