From bff9117360bdfe547e956594b72739fdfa6daa97 Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 9 Dec 2019 06:43:07 -0300 Subject: [PATCH] progress from 0 --- 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 66d9acd9b..6ca976196 100644 --- a/lbry/lbry/extras/daemon/Components.py +++ b/lbry/lbry/extras/daemon/Components.py @@ -127,9 +127,12 @@ class WalletComponent(Component): if self.wallet_manager.ledger.network.remote_height: local_height = self.wallet_manager.ledger.local_height_including_downloaded_height + disk_height = len(self.wallet_manager.ledger.headers) + download_height = local_height - disk_height if disk_height != local_height else local_height 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(local_height) / float(remote_height) * 100), 0), 100) + 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),