Skip to content

Commit

Permalink
total proofs count fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kubec committed May 27, 2021
1 parent a263449 commit 5d6dd41
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- Windows10

## Keys
- **q** - exit
9 changes: 6 additions & 3 deletions chia-log-analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]

Expand Down Expand Up @@ -307,7 +310,7 @@ func renderLastPlots() {
}

func renderFoundProofs() {
widgetFoundProofs.Text = fmt.Sprintf("%s", foundProofs)
widgetFoundProofs.Text = fmt.Sprintf("%d", foundProofs)
ui.Render(widgetFoundProofs)
}

Expand Down

0 comments on commit 5d6dd41

Please sign in to comment.