Add mining hash to GUI
This commit is contained in:
parent
75df148ba2
commit
0c5a747ef1
|
@ -14,6 +14,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/utils"
|
"github.com/ethereum/go-ethereum/utils"
|
||||||
"github.com/go-qml/qml"
|
"github.com/go-qml/qml"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
@ -369,11 +370,14 @@ func (gui *Gui) update() {
|
||||||
}
|
}
|
||||||
|
|
||||||
case <-generalUpdateTicker.C:
|
case <-generalUpdateTicker.C:
|
||||||
|
statusText := "#" + gui.eth.BlockChain().CurrentBlock.Number.String()
|
||||||
if gui.miner != nil {
|
if gui.miner != nil {
|
||||||
pow := gui.miner.GetPow()
|
pow := gui.miner.GetPow()
|
||||||
fmt.Println("HashRate from miner", pow.GetHashrate())
|
if pow.GetHashrate() != 0 {
|
||||||
|
statusText = "Mining @ " + strconv.FormatInt(pow.GetHashrate(), 10) + "Khash - " + statusText
|
||||||
}
|
}
|
||||||
lastBlockLabel.Set("text", "#"+gui.eth.BlockChain().CurrentBlock.Number.String())
|
}
|
||||||
|
lastBlockLabel.Set("text", statusText)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue