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
ce239333
Commit
ce239333
authored
Feb 13, 2015
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update balance label when mining
parent
0f3c25b2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
2 deletions
+18
-2
wallet.qml
cmd/mist/assets/qml/views/wallet.qml
+11
-0
gui.go
cmd/mist/gui.go
+3
-1
block.go
core/types/block.go
+2
-0
worker.go
miner/worker.go
+2
-1
No files found.
cmd/mist/assets/qml/views/wallet.qml
View file @
ce239333
...
@@ -15,6 +15,17 @@ Rectangle {
...
@@ -15,6 +15,17 @@ Rectangle {
objectName
:
"walletView"
objectName
:
"walletView"
anchors.fill
:
parent
anchors.fill
:
parent
Label
{
objectName
:
"balanceLabel"
visible
:
false
font.pixelSize
:
10
anchors.right
:
lastBlockLabel
.
left
anchors.rightMargin
:
5
onTextChanged
:
{
menuItem
.
secondaryTitle
=
text
}
}
function
onReady
()
{
function
onReady
()
{
setBalance
()
setBalance
()
}
}
...
...
cmd/mist/gui.go
View file @
ce239333
...
@@ -412,7 +412,9 @@ func (gui *Gui) update() {
...
@@ -412,7 +412,9 @@ func (gui *Gui) update() {
switch
ev
:=
ev
.
(
type
)
{
switch
ev
:=
ev
.
(
type
)
{
case
core
.
NewBlockEvent
:
case
core
.
NewBlockEvent
:
gui
.
processBlock
(
ev
.
Block
,
false
)
gui
.
processBlock
(
ev
.
Block
,
false
)
gui
.
setWalletValue
(
gui
.
eth
.
ChainManager
()
.
State
()
.
GetBalance
(
gui
.
address
()),
nil
)
//gui.setWalletValue(gui.eth.ChainManager().State().GetBalance(gui.address()), nil)
balance
:=
ethutil
.
CurrencyToString
(
gui
.
eth
.
ChainManager
()
.
State
()
.
GetBalance
(
gui
.
address
()))
gui
.
getObjectByName
(
"balanceLabel"
)
.
Set
(
"text"
,
fmt
.
Sprintf
(
"%v"
,
balance
))
case
core
.
TxPreEvent
:
case
core
.
TxPreEvent
:
tx
:=
ev
.
Tx
tx
:=
ev
.
Tx
...
...
core/types/block.go
View file @
ce239333
...
@@ -6,6 +6,7 @@ import (
...
@@ -6,6 +6,7 @@ import (
"math/big"
"math/big"
"sort"
"sort"
"time"
"time"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/rlp"
"github.com/ethereum/go-ethereum/rlp"
...
@@ -175,6 +176,7 @@ func (self *Block) RlpDataForStorage() interface{} {
...
@@ -175,6 +176,7 @@ func (self *Block) RlpDataForStorage() interface{} {
// Header accessors (add as you need them)
// Header accessors (add as you need them)
func
(
self
*
Block
)
Number
()
*
big
.
Int
{
return
self
.
header
.
Number
}
func
(
self
*
Block
)
Number
()
*
big
.
Int
{
return
self
.
header
.
Number
}
func
(
self
*
Block
)
NumberU64
()
uint64
{
return
self
.
header
.
Number
.
Uint64
()
}
func
(
self
*
Block
)
NumberU64
()
uint64
{
return
self
.
header
.
Number
.
Uint64
()
}
func
(
self
*
Block
)
Nonce
()
[]
byte
{
return
self
.
header
.
Nonce
}
func
(
self
*
Block
)
Bloom
()
[]
byte
{
return
self
.
header
.
Bloom
}
func
(
self
*
Block
)
Bloom
()
[]
byte
{
return
self
.
header
.
Bloom
}
func
(
self
*
Block
)
Coinbase
()
[]
byte
{
return
self
.
header
.
Coinbase
}
func
(
self
*
Block
)
Coinbase
()
[]
byte
{
return
self
.
header
.
Coinbase
}
func
(
self
*
Block
)
Time
()
int64
{
return
int64
(
self
.
header
.
Time
)
}
func
(
self
*
Block
)
Time
()
int64
{
return
int64
(
self
.
header
.
Time
)
}
...
...
miner/worker.go
View file @
ce239333
...
@@ -127,7 +127,8 @@ out:
...
@@ -127,7 +127,8 @@ out:
func
(
self
*
worker
)
wait
()
{
func
(
self
*
worker
)
wait
()
{
for
{
for
{
for
work
:=
range
self
.
recv
{
for
work
:=
range
self
.
recv
{
if
self
.
current
.
block
.
Number
()
.
Uint64
()
==
work
.
Number
{
block
:=
self
.
current
.
block
if
block
.
Number
()
.
Uint64
()
==
work
.
Number
&&
block
.
Nonce
()
==
nil
{
self
.
current
.
block
.
Header
()
.
Nonce
=
work
.
Nonce
self
.
current
.
block
.
Header
()
.
Nonce
=
work
.
Nonce
self
.
chain
.
InsertChain
(
types
.
Blocks
{
self
.
current
.
block
})
self
.
chain
.
InsertChain
(
types
.
Blocks
{
self
.
current
.
block
})
...
...
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