good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
2b9f1680
Commit
2b9f1680
authored
Jul 18, 2014
by
Maran Hidskes
Browse files
Options
Downloads
Patches
Plain Diff
WIP to expose hashrate to gui
parent
44296c0b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ethereal/gui.go
+8
-0
8 additions, 0 deletions
ethereal/gui.go
utils/cmd.go
+4
-0
4 additions, 0 deletions
utils/cmd.go
with
12 additions
and
0 deletions
ethereal/gui.go
+
8
−
0
View file @
2b9f1680
...
...
@@ -7,6 +7,7 @@ import (
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethdb"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethminer"
"github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethwire"
...
...
@@ -40,6 +41,8 @@ type Gui struct {
Session
string
clientIdentity
*
ethwire
.
SimpleClientIdentity
config
*
ethutil
.
ConfigManager
miner
*
ethminer
.
Miner
}
// Create GUI, but doesn't start it
...
...
@@ -124,6 +127,7 @@ func (gui *Gui) ToggleMining() {
txt
=
"Start mining"
}
else
{
utils
.
StartMining
(
gui
.
eth
)
gui
.
miner
=
utils
.
GetMiner
()
txt
=
"Stop mining"
}
...
...
@@ -346,6 +350,10 @@ func (gui *Gui) update() {
case
<-
peerChan
:
gui
.
setPeerInfo
()
case
<-
ticker
.
C
:
if
gui
.
miner
!=
nil
{
pow
:=
gui
.
miner
.
GetPow
()
fmt
.
Println
(
"HashRate from miner"
,
pow
.
GetHashrate
())
}
gui
.
setPeerInfo
()
}
}
...
...
This diff is collapsed.
Click to expand it.
utils/cmd.go
+
4
−
0
View file @
2b9f1680
...
...
@@ -236,6 +236,10 @@ func StartRpc(ethereum *eth.Ethereum, RpcPort int) {
var
miner
ethminer
.
Miner
func
GetMiner
()
*
ethminer
.
Miner
{
return
&
miner
}
func
StartMining
(
ethereum
*
eth
.
Ethereum
)
bool
{
if
!
ethereum
.
Mining
{
ethereum
.
Mining
=
true
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment