From c85127d76b4ec77ffd8ed02381d4df23e2f85f1c Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 18 Dec 2019 10:44:16 -0500 Subject: [PATCH] fix division by zero error --- lbry/lbry/extras/daemon/Components.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lbry/lbry/extras/daemon/Components.py b/lbry/lbry/extras/daemon/Components.py index 6ca976196..6da6ba71c 100644 --- a/lbry/lbry/extras/daemon/Components.py +++ b/lbry/lbry/extras/daemon/Components.py @@ -132,7 +132,10 @@ class WalletComponent(Component): remote_height = self.wallet_manager.ledger.network.remote_height target_height = remote_height - disk_height if disk_height != local_height else remote_height best_hash = self.wallet_manager.get_best_blockhash() - progress = min(max(math.ceil(float(download_height) / float(target_height) * 100), 0), 100) + if not target_height: + progress = 100 + else: + progress = min(max(math.ceil(float(download_height) / float(target_height) * 100), 0), 100) result.update({ 'headers_synchronization_progress': progress, 'blocks': max(local_height, 0),