When loading a wallet, updating the state based on the chain data prior to AttachChain results in some blocks being missed, which leads to inconsistent state information that can cause assertion failures. Moving the state updating inside of AttachChain after the chain notifications handler has been attached ensures that the state will always be up to date with the tip that the wallet is tracking.
Fixes #34599