[electrum] fix handling of a single block reorg
Summary:
Fix the network code handling reorgs to not cause the server to be disconnected when a block is parked and the next block takes some time to replace it.
Test how Electrum handles a reorg wrt to the server_height and block_height.
In the new test case, we have one block reorged (parked by Avalanche because of a policy violation) after it was initially accepted by the node, and we test each intermediate step as the chain grows longer again.
In the existing test, we keep testing a multi-block reorg by a longer fork. We adds the checks for the local and server height.
Depends on D14968
Test Plan:
for i in {0..20}; do pytest electrumabc/tests/regtest/test_reorg.py ; done pytest electrumabc/tests
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D14944