Skip to content

Commit

Permalink
avoid panic
Browse files Browse the repository at this point in the history
  • Loading branch information
s1mple1122 committed Feb 28, 2022
1 parent 6d0066e commit 296ae43
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/lotus-miner/sealing.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ func barString(total, y, g float64) string {
yBars := int(math.Round(y / total * barCols))
gBars := int(math.Round(g / total * barCols))
eBars := int(barCols) - yBars - gBars
return color.YellowString(strings.Repeat("|", yBars)) +
color.GreenString(strings.Repeat("|", gBars)) +
strings.Repeat(" ", eBars)
var barString = color.YellowString(strings.Repeat("|", yBars)) +
color.GreenString(strings.Repeat("|", gBars))
if eBars >= 0 {
barString += strings.Repeat(" ", eBars)
}
return barString
}

var sealingWorkersCmd = &cli.Command{
Expand Down

0 comments on commit 296ae43

Please sign in to comment.