Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
2b9f1680
Commit
2b9f1680
authored
Jul 18, 2014
by
Maran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP to expose hashrate to gui
parent
44296c0b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
gui.go
ethereal/gui.go
+8
-0
cmd.go
utils/cmd.go
+4
-0
No files found.
ethereal/gui.go
View file @
2b9f1680
...
@@ -7,6 +7,7 @@ import (
...
@@ -7,6 +7,7 @@ import (
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethdb"
"github.com/ethereum/eth-go/ethdb"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethlog"
"github.com/ethereum/eth-go/ethminer"
"github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethpub"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethwire"
"github.com/ethereum/eth-go/ethwire"
...
@@ -40,6 +41,8 @@ type Gui struct {
...
@@ -40,6 +41,8 @@ type Gui struct {
Session
string
Session
string
clientIdentity
*
ethwire
.
SimpleClientIdentity
clientIdentity
*
ethwire
.
SimpleClientIdentity
config
*
ethutil
.
ConfigManager
config
*
ethutil
.
ConfigManager
miner
*
ethminer
.
Miner
}
}
// Create GUI, but doesn't start it
// Create GUI, but doesn't start it
...
@@ -124,6 +127,7 @@ func (gui *Gui) ToggleMining() {
...
@@ -124,6 +127,7 @@ func (gui *Gui) ToggleMining() {
txt
=
"Start mining"
txt
=
"Start mining"
}
else
{
}
else
{
utils
.
StartMining
(
gui
.
eth
)
utils
.
StartMining
(
gui
.
eth
)
gui
.
miner
=
utils
.
GetMiner
()
txt
=
"Stop mining"
txt
=
"Stop mining"
}
}
...
@@ -346,6 +350,10 @@ func (gui *Gui) update() {
...
@@ -346,6 +350,10 @@ func (gui *Gui) update() {
case
<-
peerChan
:
case
<-
peerChan
:
gui
.
setPeerInfo
()
gui
.
setPeerInfo
()
case
<-
ticker
.
C
:
case
<-
ticker
.
C
:
if
gui
.
miner
!=
nil
{
pow
:=
gui
.
miner
.
GetPow
()
fmt
.
Println
(
"HashRate from miner"
,
pow
.
GetHashrate
())
}
gui
.
setPeerInfo
()
gui
.
setPeerInfo
()
}
}
}
}
...
...
utils/cmd.go
View file @
2b9f1680
...
@@ -236,6 +236,10 @@ func StartRpc(ethereum *eth.Ethereum, RpcPort int) {
...
@@ -236,6 +236,10 @@ func StartRpc(ethereum *eth.Ethereum, RpcPort int) {
var
miner
ethminer
.
Miner
var
miner
ethminer
.
Miner
func
GetMiner
()
*
ethminer
.
Miner
{
return
&
miner
}
func
StartMining
(
ethereum
*
eth
.
Ethereum
)
bool
{
func
StartMining
(
ethereum
*
eth
.
Ethereum
)
bool
{
if
!
ethereum
.
Mining
{
if
!
ethereum
.
Mining
{
ethereum
.
Mining
=
true
ethereum
.
Mining
=
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment