The wallet crashes if it processes the same block disconnection event twice in a row due
to an incompatible coinbase transaction state.
This happens because disconnectBlock provides TxStateInactive without the “abandoned”
flag for coinbase transactions to SyncTransaction, while AddToWallet() internally modifies
it to retain the abandoned state.
The crash flow is as follows:
- 
On the first disconnection, the transaction state transitions from “confirmed” to “inactive,” bypassing the state equality check since the provided state differs. Then, AddToWalletinternally updates the state to “inactive + abandoned”
- 
On the second disconnection, as we provide only the “inactive” state to SyncTransaction(), the state equality assertion fails and crashes the wallet.
Reviewers Note: The crash can easily be replicated by cherry-picking the test commit in master.