Files
bitcoin/src/wallet
furszy a18085a18b wallet: fix crash on double block disconnection
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 flow is as follows:
1) On the first disconnection, the transaction state transitions from "confirmed" to
"inactive," bypassing the state equality check since the provided state differs. Then,
'AddToWallet' internally updates the state to "inactive + abandoned"

2) On the second disconnection, as we provide only the "inactive" state
to 'SyncTransaction()', the state equality assertion fails and crashes the wallet.

Github-Pull: #31757
Rebased-From: 9ef429b6ae
2025-06-19 10:39:27 +01:00
..
2024-08-29 13:49:57 +02:00
2024-08-28 19:09:51 +02:00
2024-10-21 08:29:22 -03:00
2025-01-14 19:01:53 +01:00
2023-03-23 12:55:18 +01:00