1
0

network: auto-switch servers to preferred fork (or longest chain)

If auto_connect is enabled, allow jumping between forks too.
(Previously auto_connect was only switching servers on a given fork,
not across forks)
If there is a preferred fork set, jump to that (and stay);
if there isn't, always jump to the longest fork.
This commit is contained in:
SomberNight
2018-10-11 19:42:38 +02:00
parent 1ef804c652
commit 37206ec08e
6 changed files with 103 additions and 59 deletions

View File

@@ -156,7 +156,7 @@ class SPV(NetworkJobOnDefaultServer):
async def _maybe_undo_verifications(self):
def undo_verifications():
height = self.blockchain.get_forkpoint()
height = self.blockchain.get_max_forkpoint()
self.print_error("undoing verifications back to height {}".format(height))
tx_hashes = self.wallet.undo_verifications(self.blockchain, height)
for tx_hash in tx_hashes: