Skip to content

Commit 0c5a747

Browse files
author
Maran
committed
Add mining hash to GUI
1 parent 75df148 commit 0c5a747

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ethereal/gui.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"github.com/ethereum/go-ethereum/utils"
1515
"github.com/go-qml/qml"
1616
"math/big"
17+
"strconv"
1718
"strings"
1819
"time"
1920
)
@@ -369,11 +370,14 @@ func (gui *Gui) update() {
369370
}
370371

371372
case <-generalUpdateTicker.C:
373+
statusText := "#" + gui.eth.BlockChain().CurrentBlock.Number.String()
372374
if gui.miner != nil {
373375
pow := gui.miner.GetPow()
374-
fmt.Println("HashRate from miner", pow.GetHashrate())
376+
if pow.GetHashrate() != 0 {
377+
statusText = "Mining @ " + strconv.FormatInt(pow.GetHashrate(), 10) + "Khash - " + statusText
378+
}
375379
}
376-
lastBlockLabel.Set("text", "#"+gui.eth.BlockChain().CurrentBlock.Number.String())
380+
lastBlockLabel.Set("text", statusText)
377381
}
378382
}
379383
}

0 commit comments

Comments
 (0)