Page MenuHomePhabricator

wallet: validationinterface: only handle active chain notifications
ClosedPublic

Authored by PiRK on Thu, Apr 10, 12:57.

Details

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

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Thu, Apr 10, 12:57

@bot build-chronik

src/validation.cpp
3106 ↗(On Diff #53438)

debug stuff here

This revision is now accepted and ready to land.Thu, Apr 10, 13:28