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
1ab865a9
Commit
1ab865a9
authored
May 27, 2014
by
Maran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding new blocks on broadcast
parent
07204f12
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
wallet.qml
ethereal/assets/qml/wallet.qml
+11
-2
gui.go
ethereal/ui/gui.go
+4
-3
No files found.
ethereal/assets/qml/wallet.qml
View file @
1ab865a9
...
@@ -642,13 +642,22 @@ ApplicationWindow {
...
@@ -642,13 +642,22 @@ ApplicationWindow {
txModel
.
insert
(
0
,
{
inout
:
inout
,
hash
:
tx
.
hash
,
address
:
tx
.
address
,
value
:
tx
.
value
,
contract
:
isContract
})
txModel
.
insert
(
0
,
{
inout
:
inout
,
hash
:
tx
.
hash
,
address
:
tx
.
address
,
value
:
tx
.
value
,
contract
:
isContract
})
}
}
function
addBlock
(
block
)
{
function
addBlock
(
block
,
initial
)
{
var
txs
=
JSON
.
parse
(
block
.
transactions
);
var
txs
=
JSON
.
parse
(
block
.
transactions
);
var
amount
=
0
var
amount
=
0
if
(
initial
==
undefined
){
initial
=
false
}
if
(
txs
!=
null
){
if
(
txs
!=
null
){
amount
=
txs
.
length
amount
=
txs
.
length
}
}
blockModel
.
insert
(
0
,
{
number
:
block
.
number
,
hash
:
block
.
hash
,
txs
:
txs
,
txAmount
:
amount
,
time
:
block
.
time
,
prettyTime
:
convertToPretty
(
block
.
time
)})
if
(
initial
){
blockModel
.
append
({
number
:
block
.
number
,
hash
:
block
.
hash
,
txs
:
txs
,
txAmount
:
amount
,
time
:
block
.
time
,
prettyTime
:
convertToPretty
(
block
.
time
)})
}
else
{
blockModel
.
insert
(
0
,
{
number
:
block
.
number
,
hash
:
block
.
hash
,
txs
:
txs
,
txAmount
:
amount
,
time
:
block
.
time
,
prettyTime
:
convertToPretty
(
block
.
time
)})
}
}
}
function
addLog
(
str
)
{
function
addLog
(
str
)
{
...
...
ethereal/ui/gui.go
View file @
1ab865a9
...
@@ -141,7 +141,7 @@ func (gui *Gui) setInitialBlockChain() {
...
@@ -141,7 +141,7 @@ func (gui *Gui) setInitialBlockChain() {
blk
:=
gui
.
eth
.
BlockChain
()
.
GetBlock
(
sBlk
)
blk
:=
gui
.
eth
.
BlockChain
()
.
GetBlock
(
sBlk
)
for
;
blk
!=
nil
;
blk
=
gui
.
eth
.
BlockChain
()
.
GetBlock
(
sBlk
)
{
for
;
blk
!=
nil
;
blk
=
gui
.
eth
.
BlockChain
()
.
GetBlock
(
sBlk
)
{
sBlk
=
blk
.
PrevHash
sBlk
=
blk
.
PrevHash
gui
.
processBlock
(
blk
)
gui
.
processBlock
(
blk
,
true
)
}
}
}
}
...
@@ -163,8 +163,8 @@ func (gui *Gui) readPreviousTransactions() {
...
@@ -163,8 +163,8 @@ func (gui *Gui) readPreviousTransactions() {
it
.
Release
()
it
.
Release
()
}
}
func
(
gui
*
Gui
)
processBlock
(
block
*
ethchain
.
Block
)
{
func
(
gui
*
Gui
)
processBlock
(
block
*
ethchain
.
Block
,
initial
bool
)
{
gui
.
win
.
Root
()
.
Call
(
"addBlock"
,
ethpub
.
NewPBlock
(
block
))
gui
.
win
.
Root
()
.
Call
(
"addBlock"
,
ethpub
.
NewPBlock
(
block
)
,
initial
)
}
}
func
(
gui
*
Gui
)
setWalletValue
(
amount
,
unconfirmedFunds
*
big
.
Int
)
{
func
(
gui
*
Gui
)
setWalletValue
(
amount
,
unconfirmedFunds
*
big
.
Int
)
{
...
@@ -203,6 +203,7 @@ func (gui *Gui) update() {
...
@@ -203,6 +203,7 @@ func (gui *Gui) update() {
select
{
select
{
case
b
:=
<-
blockChan
:
case
b
:=
<-
blockChan
:
block
:=
b
.
Resource
.
(
*
ethchain
.
Block
)
block
:=
b
.
Resource
.
(
*
ethchain
.
Block
)
gui
.
processBlock
(
block
,
false
)
if
bytes
.
Compare
(
block
.
Coinbase
,
gui
.
addr
)
==
0
{
if
bytes
.
Compare
(
block
.
Coinbase
,
gui
.
addr
)
==
0
{
gui
.
setWalletValue
(
gui
.
eth
.
StateManager
()
.
CurrentState
()
.
GetAccount
(
gui
.
addr
)
.
Amount
,
nil
)
gui
.
setWalletValue
(
gui
.
eth
.
StateManager
()
.
CurrentState
()
.
GetAccount
(
gui
.
addr
)
.
Amount
,
nil
)
}
}
...
...
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