Page MenuHomePhabricator

validation: Send correct notification during snapshot completion
AbandonedPublicDraft

Authored by PiRK on Wed, Apr 9, 06:46.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

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#31556
https://github.com/bitcoin/bitcoin/pull/31556/commits/226d03dd610dd65938554bcf0abfe79f7ca7fb4d

Depends on D17914

TODO: squash with D17914

Test Plan

ninja all check-all

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

Fixme: it doesn't work

Event Timeline

src/validation.cpp
3102

MaybeCompleteSnapshotValidation can set one of the assumeutxo chains to disabled, causing GetRole() to return NORMAL rather than BACKGROUND. We want to signal the status of the connected block before this happens