Bug was introduced in c069c04ede338929c50297558fee15192aa0f67c, before this txpool additions were not notified on block addition
When receiving blocks with previously unknown conditions, miner data was sent first, but txpool add events for already-added transactions in previous block were sent afterward. Miners would then include already-mined transactions in their new templates due to receiving the mistimed txpool add event.
The fix is to send miner notifications AFTER txpool events are sent, and before normal block notifications are sent (for mining switch speed purposes)
Fixes c069c04ede338929c50297558fee15192aa0f67c / #9135
Fixes dfee15eee18a97be5a8fb9822527f98ebd1b33e9 / #7891
A reorg can end up causing an output's position in the chain to
move. Since the wallet doesn't update the RingDB on reorg, it
may refer to the output's stale position in the chain.
This seems a reasonable solution rather than introducing complex
logic to update the stale ring member's value on rerog, since
RingDB can be deprecated with FCMP++.
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Add macro definition for fuzzers
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Fix FuzzedDataProvider header missing problem
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Add README
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Provide static FuzzedDataProvider.h
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Update and enhance fuzzer
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Activate UBSan
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Fix fuzz target retrieval
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Remove bias selector and fix protocol lifespan
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Drop SIGALARM handling and fix bug on selectors
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Fix rpc request changes
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Add a new fuzzer profile that catch all expcetions
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Fix typo
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Add warning
Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
Fix four issues with wallet_keys_unlocker:
1. It won't decrypt if there are unlockers open simulataneously on multiple `wallet2` instances
2. It won't decrypt if the first unlocker was disabled (i.e. `locked=false`), even with a second non-disabled unlocker
3. If a destructor of an earlier unlocker is triggered before the destructor of a later unlocker, it will re-encrypt too early, while the second unlocker is still in scope
4. Calling the 3-parameter constructor with `locked=true` after an unlocker already exists will "double-encrypt" the spend key after its destructor since the local variable is `locked=false` and the field member is `locked=true`
Also, replace `wallet2::decrypt_account_for_multisig` with `wallet_keys_unlocker`.
The `while` loop condition was incorrect, which could lead to incomplete imports.
Also, setting `start` to an *undone* output speeds up the test by 16s on my machine.