HomePhabricator

[electrum] resolve past single-block reorg

Description

[electrum] resolve past single-block reorg

Summary:
Wallets that were running during the 821417 single-block reorg are stuck at the height since then, unless the user deleted the blockchain_headers file and forks directory in his data directory.
This diff will allow them to recover from the situation.

Depends on D14964

Test Plan:
Make sure the test wallet has a few transactions after block 821417.
Swap the local blockchain_headers file and forks directory with those from a stuck wallet prior to applying this patch. Start Electrum ABC, check that transactions after block 821417 show as "Not verified", and check that in the Network > Overview dialog the Blockchain label says 821417 blocks (while the server heights are much higher and match the current chain tip).

Apply the patch, start the wallet, check that the transactions get verified and the network dialog now shows a local height matching the server heights.
Send a new transaction, let it run for a few blocks and check that everything still works normally.

pytest electrumabc/tests/regtest

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14968

Details

Provenance
PiRKAuthored on Dec 12 2023, 09:09
PiRKPushed on Dec 12 2023, 14:54
Reviewer
Restricted Project
Differential Revision
D14968: [electrum] resolve past single-block reorg
Parents
rABC0b511b224a0b: [electrum] add more docstrings and typehint to network and interface code
Branches
Unknown
Tags
Unknown