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
75df148b
Commit
75df148b
authored
Jul 18, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Plain Diff
Fixed miner channel
parents
2b9f1680
4572d494
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
30 deletions
+64
-30
wallet.qml
ethereal/assets/qml/wallet.qml
+35
-23
debugger.go
ethereal/debugger.go
+3
-0
gui.go
ethereal/gui.go
+23
-4
cmd.go
utils/cmd.go
+3
-3
No files found.
ethereal/assets/qml/wallet.qml
View file @
75df148b
...
...
@@ -419,6 +419,17 @@ ApplicationWindow {
}
}
Label
{
y
:
6
id
:
lastBlockLabel
objectName
:
"lastBlockLabel"
visible
:
true
text
:
""
font.pixelSize
:
10
anchors.right
:
peerGroup
.
left
anchors.rightMargin
:
5
}
ProgressBar
{
id
:
syncProgressIndicator
visible
:
false
...
...
@@ -426,35 +437,36 @@ ApplicationWindow {
y
:
3
width
:
140
indeterminate
:
true
anchors.right
:
peer
Label
.
left
anchors.right
:
peer
Group
.
left
anchors.rightMargin
:
5
}
Label
{
y
:
7
anchors.right
:
peerImage
.
left
anchors.rightMargin
:
5
id
:
peerLabel
font.pixelSize
:
8
text
:
"0 / 0"
}
Image
{
y
:
7
id
:
peerImage
anchors.right
:
parent
.
right
width
:
10
;
height
:
10
MouseArea
{
onDoubleClicked
:
peerWindow
.
visible
=
true
anchors.fill
:
parent
}
source
:
"../network.png"
}
RowLayout
{
id
:
peerGroup
y
:
7
anchors.right
:
parent
.
right
MouseArea
{
onDoubleClicked
:
peerWindow
.
visible
=
true
anchors.fill
:
parent
}
Label
{
id
:
peerLabel
font.pixelSize
:
8
text
:
"0 / 0"
}
Image
{
id
:
peerImage
width
:
10
;
height
:
10
source
:
"../network.png"
}
}
}
Window
{
id
:
popup
visible
:
false
flags
:
Qt
.
CustomizeWindowHint
|
Qt
.
Tool
|
Qt
.
WindowCloseButtonHint
//
flags: Qt.CustomizeWindowHint | Qt.Tool | Qt.WindowCloseButtonHint
property
var
block
width
:
root
.
width
height
:
300
...
...
@@ -589,7 +601,7 @@ ApplicationWindow {
Window
{
id
:
addPeerWin
flags
:
Qt
.
CustomizeWindowHint
|
Qt
.
Tool
|
Qt
.
WindowCloseButtonHint
//
flags: Qt.CustomizeWindowHint | Qt.Tool | Qt.WindowCloseButtonHint
visible
:
false
minimumWidth
:
230
maximumWidth
:
230
...
...
@@ -756,7 +768,7 @@ ApplicationWindow {
// ******************************************
Window
{
id
:
peerWindow
flags
:
Qt
.
CustomizeWindowHint
|
Qt
.
Tool
|
Qt
.
WindowCloseButtonHint
//
flags: Qt.CustomizeWindowHint | Qt.Tool | Qt.WindowCloseButtonHint
height
:
200
width
:
700
Rectangle
{
...
...
ethereal/debugger.go
View file @
75df148b
...
...
@@ -17,6 +17,8 @@ type DebuggerWindow struct {
vm
*
ethchain
.
Vm
Db
*
Debugger
state
*
ethchain
.
State
}
func
NewDebuggerWindow
(
lib
*
UiLib
)
*
DebuggerWindow
{
...
...
@@ -53,6 +55,7 @@ func (self *DebuggerWindow) SetCode(code string) {
func
(
self
*
DebuggerWindow
)
SetData
(
data
string
)
{
self
.
win
.
Set
(
"dataText"
,
data
)
}
func
(
self
*
DebuggerWindow
)
SetAsm
(
data
[]
byte
)
{
self
.
win
.
Root
()
.
Call
(
"clearAsm"
)
...
...
ethereal/gui.go
View file @
75df148b
...
...
@@ -270,6 +270,10 @@ func (gui *Gui) setWalletValue(amount, unconfirmedFunds *big.Int) {
gui
.
win
.
Root
()
.
Call
(
"setWalletValue"
,
str
)
}
func
(
self
*
Gui
)
getObjectByName
(
objectName
string
)
qml
.
Object
{
return
self
.
win
.
Root
()
.
ObjectByName
(
objectName
)
}
// Simple go routine function that updates the list of peers in the GUI
func
(
gui
*
Gui
)
update
()
{
reactor
:=
gui
.
eth
.
Reactor
()
...
...
@@ -280,12 +284,15 @@ func (gui *Gui) update() {
objectChan
=
make
(
chan
ethutil
.
React
,
1
)
peerChan
=
make
(
chan
ethutil
.
React
,
1
)
chainSyncChan
=
make
(
chan
ethutil
.
React
,
1
)
miningChan
=
make
(
chan
ethutil
.
React
,
1
)
)
reactor
.
Subscribe
(
"newBlock"
,
blockChan
)
reactor
.
Subscribe
(
"newTx:pre"
,
txChan
)
reactor
.
Subscribe
(
"newTx:post"
,
txChan
)
reactor
.
Subscribe
(
"chainSync"
,
chainSyncChan
)
reactor
.
Subscribe
(
"miner:start"
,
miningChan
)
reactor
.
Subscribe
(
"miner:stop"
,
miningChan
)
nameReg
:=
ethpub
.
EthereumConfig
(
gui
.
eth
.
StateManager
())
.
NameReg
()
if
nameReg
!=
nil
{
...
...
@@ -293,13 +300,16 @@ func (gui *Gui) update() {
}
reactor
.
Subscribe
(
"peerList"
,
peerChan
)
ticker
:=
time
.
NewTicker
(
5
*
time
.
Second
)
peerUpdateTicker
:=
time
.
NewTicker
(
5
*
time
.
Second
)
generalUpdateTicker
:=
time
.
NewTicker
(
1
*
time
.
Second
)
state
:=
gui
.
eth
.
StateManager
()
.
TransState
()
unconfirmedFunds
:=
new
(
big
.
Int
)
gui
.
win
.
Root
()
.
Call
(
"setWalletValue"
,
fmt
.
Sprintf
(
"%v"
,
ethutil
.
CurrencyToString
(
state
.
GetAccount
(
gui
.
address
())
.
Amount
)))
gui
.
win
.
Root
()
.
ObjectByName
(
"syncProgressIndicator"
)
.
Set
(
"visible"
,
!
gui
.
eth
.
IsUpToDate
())
gui
.
getObjectByName
(
"syncProgressIndicator"
)
.
Set
(
"visible"
,
!
gui
.
eth
.
IsUpToDate
())
lastBlockLabel
:=
gui
.
getObjectByName
(
"lastBlockLabel"
)
for
{
select
{
...
...
@@ -349,12 +359,21 @@ func (gui *Gui) update() {
gui
.
loadAddressBook
()
case
<-
peerChan
:
gui
.
setPeerInfo
()
case
<-
ticker
.
C
:
case
<-
peerUpdateTicker
.
C
:
gui
.
setPeerInfo
()
case
msg
:=
<-
miningChan
:
if
msg
.
Event
==
"miner:start"
{
gui
.
miner
=
msg
.
Resource
.
(
*
ethminer
.
Miner
)
}
else
{
gui
.
miner
=
nil
}
case
<-
generalUpdateTicker
.
C
:
if
gui
.
miner
!=
nil
{
pow
:=
gui
.
miner
.
GetPow
()
fmt
.
Println
(
"HashRate from miner"
,
pow
.
GetHashrate
())
}
gui
.
setPeerInfo
(
)
lastBlockLabel
.
Set
(
"text"
,
"#"
+
gui
.
eth
.
BlockChain
()
.
CurrentBlock
.
Number
.
String
()
)
}
}
}
...
...
utils/cmd.go
View file @
75df148b
...
...
@@ -234,10 +234,10 @@ func StartRpc(ethereum *eth.Ethereum, RpcPort int) {
}
}
var
miner
ethminer
.
Miner
var
miner
*
ethminer
.
Miner
func
GetMiner
()
*
ethminer
.
Miner
{
return
&
miner
return
miner
}
func
StartMining
(
ethereum
*
eth
.
Ethereum
)
bool
{
...
...
@@ -267,7 +267,7 @@ func StartMining(ethereum *eth.Ethereum) bool {
}
func
StopMining
(
ethereum
*
eth
.
Ethereum
)
bool
{
if
ethereum
.
Mining
{
if
ethereum
.
Mining
&&
miner
!=
nil
{
miner
.
Stop
()
logger
.
Infoln
(
"Miner stopped"
)
ethereum
.
Mining
=
false
...
...
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