HomePhabricator

wallet: validationinterface: only handle active chain notifications

Description

wallet: validationinterface: only handle active chain notifications

Summary:

wallet: validationinterface: only handle active chain notifications

validation: Send correct notification during snapshot completion

If AssumeUtxo background sync is completed in this
ActivateBestChain() call, the GetRole() function
returns "normal" instead of "background" for this chainstate.
This would make the wallet (which ignores BlockConnected
notifcation for the background chainstate) process it, change
m_last_block_processed_height, and display an incorrect
balance.

This is a partial backport of core#27596 and core#31556
https://github.com/bitcoin/bitcoin/pull/31556/commits/226d03dd610dd65938554bcf0abfe79f7ca7fb4d
https://github.com/bitcoin/bitcoin/pull/27596/commits/fbe0a7d7ca680358237b6c2369b3fd2b43221113

The chainstate role must be passed down the function stack to ActivateBestChainStep and ConnectTip because of the change made in D16539: the BlockConnected signal is send directly by ConnectTip rather than being queued to be sent later in ActiveBestChain

Test Plan:
ninja all check-all

Run the wallet_assumeutxo.py test with the https://github.com/bitcoin/bitcoin/pull/31556/commits/bc43ecaf6dc0830a27296d3a29428814fed07bb1 test

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D17918

Details

Provenance
James O'Beirne <james.obeirne@pm.me>Authored on Nov 10 2022, 21:09
PiRKCommitted on Thu, Apr 10, 21:55
PiRKPushed on Thu, Apr 10, 21:55
Reviewer
Restricted Project
Differential Revision
D17918: wallet: validationinterface: only handle active chain notifications
Parents
rABCe0776c77fd38: [avalanche] Remove requirement that local staking rewards have to be computed…
Branches
Unknown
Tags
Unknown