From 5d6dd414a6ef022409d4d7abf8246e8fcd2010e3 Mon Sep 17 00:00:00 2001 From: Michal Kubec Date: Thu, 27 May 2021 17:00:17 +0200 Subject: [PATCH] total proofs count fix --- README.md | 5 ++++- chia-log-analyzer.go | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1fd7363..2f76de1 100644 --- a/README.md +++ b/README.md @@ -15,4 +15,7 @@ chia-log-analyzer.go-linux-amd64 --log=/path/to/debug.log ## Supported platforms - Linux (tested on Ubuntu) - RPI4 (use linux-arm builds) -- Windows10 \ No newline at end of file +- Windows10 + +## Keys +- **q** - exit \ No newline at end of file diff --git a/chia-log-analyzer.go b/chia-log-analyzer.go index d474556..3bbd906 100644 --- a/chia-log-analyzer.go +++ b/chia-log-analyzer.go @@ -41,7 +41,7 @@ var totalFarmingPlotsNumber = "0" var totalFarmingAttempt = 0 var positiveFarmingAttempt = 0 -var foundProofs = "0" +var foundProofs = 0 var farmingTime = "0" var totalPlots = "0" var minFarmingTime = 999999.0 @@ -250,7 +250,10 @@ func parseLines(lines []string) { match := regexPlotsFarming.FindStringSubmatch(s) farmingPlotsNumber, _ := strconv.Atoi(match[1]) - foundProofs = match[2] + foundProofsActual, _ := strconv.Atoi(match[2]) + if foundProofsActual > 0 { + foundProofs = foundProofs + foundProofsActual + } farmingTime = match[3] totalPlots = match[4] @@ -307,7 +310,7 @@ func renderLastPlots() { } func renderFoundProofs() { - widgetFoundProofs.Text = fmt.Sprintf("%s", foundProofs) + widgetFoundProofs.Text = fmt.Sprintf("%d", foundProofs) ui.Render(widgetFoundProofs) }