From 25208e4374962a2c8dcae8d93be38c7ee07c2fd1 Mon Sep 17 00:00:00 2001 From: Arinerron Date: Tue, 12 Jun 2018 22:50:55 -0700 Subject: [PATCH] Fix division-by-zero error --- onionr/onionr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onionr/onionr.py b/onionr/onionr.py index f64aba17..d3d7ee4f 100755 --- a/onionr/onionr.py +++ b/onionr/onionr.py @@ -622,7 +622,7 @@ class Onionr: 'Known Peers Count' : str(len(self.onionrCore.listPeers()) - 1), 'Enabled Plugins Count' : str(len(config.get('plugins')['enabled'])) + ' / ' + str(len(os.listdir('data/plugins/'))), 'Known Blocks Count' : str(totalBlocks), - 'Percent Blocks Signed' : str(round(100 * signedBlocks / totalBlocks, 2)) + '%' # TODO: div by zero error + 'Percent Blocks Signed' : str(round(100 * signedBlocks / max(totalBlocks, 1), 2)) + '%' } # color configuration