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
47a58b40
Commit
47a58b40
authored
May 27, 2014
by
Maran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed recursive function for loop
parent
474c85bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
15 deletions
+8
-15
wallet.qml
ethereal/assets/qml/wallet.qml
+4
-4
gui.go
ethereal/ui/gui.go
+4
-11
No files found.
ethereal/assets/qml/wallet.qml
View file @
47a58b40
...
@@ -643,12 +643,12 @@ ApplicationWindow {
...
@@ -643,12 +643,12 @@ ApplicationWindow {
}
}
function
addBlock
(
block
)
{
function
addBlock
(
block
)
{
var
objtt
=
JSON
.
parse
(
block
.
transactions
);
var
txs
=
JSON
.
parse
(
block
.
transactions
);
var
amount
=
0
var
amount
=
0
if
(
objtt
!=
null
){
if
(
txs
!=
null
){
amount
=
objtt
.
length
amount
=
txs
.
length
}
}
blockModel
.
insert
(
0
,
{
number
:
block
.
number
,
hash
:
block
.
hash
,
txs
:
objtt
,
txAmount
:
amount
,
time
:
block
.
time
,
prettyTime
:
convertToPretty
(
block
.
time
)})
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 @
47a58b40
...
@@ -136,20 +136,13 @@ func (gui *Gui) createWindow(comp qml.Object) *qml.Window {
...
@@ -136,20 +136,13 @@ func (gui *Gui) createWindow(comp qml.Object) *qml.Window {
return
gui
.
win
return
gui
.
win
}
}
func
(
gui
*
Gui
)
recursiveAdd
(
sBlk
[]
byte
)
{
func
(
gui
*
Gui
)
setInitialBlockChain
()
{
sBlk
:=
gui
.
eth
.
BlockChain
()
.
LastBlockHash
blk
:=
gui
.
eth
.
BlockChain
()
.
GetBlock
(
sBlk
)
blk
:=
gui
.
eth
.
BlockChain
()
.
GetBlock
(
sBlk
)
if
blk
!=
nil
{
for
;
blk
!=
nil
;
blk
=
gui
.
eth
.
BlockChain
()
.
GetBlock
(
sBlk
)
{
//ethutil.Config.Log.Infoln("Adding block", blk)
sBlk
=
blk
.
PrevHash
gui
.
processBlock
(
blk
)
gui
.
processBlock
(
blk
)
gui
.
recursiveAdd
(
blk
.
PrevHash
)
return
}
else
{
//ethutil.Config.Log.Debugln("At Genesis, added all blocks to GUI")
}
}
return
}
func
(
gui
*
Gui
)
setInitialBlockChain
()
{
gui
.
recursiveAdd
(
gui
.
eth
.
BlockChain
()
.
LastBlockHash
)
}
}
func
(
gui
*
Gui
)
readPreviousTransactions
()
{
func
(
gui
*
Gui
)
readPreviousTransactions
()
{
...
...
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