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
95a48cea
Commit
95a48cea
authored
Feb 21, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Peer amount update
parent
aaac0c99
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
network.png
network.png
+0
-0
gui.go
ui/gui.go
+9
-0
wallet.qml
wallet.qml
+19
-0
No files found.
network.png
0 → 100644
View file @
95a48cea
2.83 KB
ui/gui.go
View file @
95a48cea
...
@@ -9,6 +9,7 @@ import (
...
@@ -9,6 +9,7 @@ import (
"github.com/ethereum/eth-go/ethutil"
"github.com/ethereum/eth-go/ethutil"
"github.com/niemeyer/qml"
"github.com/niemeyer/qml"
"strings"
"strings"
"time"
)
)
type
Gui
struct
{
type
Gui
struct
{
...
@@ -55,6 +56,7 @@ func (ui *Gui) Start() {
...
@@ -55,6 +56,7 @@ func (ui *Gui) Start() {
ui
.
eth
.
BlockManager
.
SecondaryBlockProcessor
=
ui
ui
.
eth
.
BlockManager
.
SecondaryBlockProcessor
=
ui
go
ui
.
setInitialBlockChain
()
go
ui
.
setInitialBlockChain
()
go
ui
.
updatePeers
()
ui
.
win
.
Show
()
ui
.
win
.
Show
()
ui
.
win
.
Wait
()
ui
.
win
.
Wait
()
...
@@ -73,6 +75,13 @@ func (ui *Gui) ProcessBlock(block *ethchain.Block) {
...
@@ -73,6 +75,13 @@ func (ui *Gui) ProcessBlock(block *ethchain.Block) {
ui
.
win
.
Root
()
.
Call
(
"addBlock"
,
NewBlockFromBlock
(
block
))
ui
.
win
.
Root
()
.
Call
(
"addBlock"
,
NewBlockFromBlock
(
block
))
}
}
func
(
ui
*
Gui
)
updatePeers
()
{
for
{
ui
.
win
.
Root
()
.
Call
(
"setPeers"
,
fmt
.
Sprintf
(
"%d / %d"
,
ui
.
eth
.
Peers
()
.
Len
(),
ui
.
eth
.
MaxPeers
))
time
.
Sleep
(
1
*
time
.
Second
)
}
}
type
Tester
struct
{
type
Tester
struct
{
root
qml
.
Object
root
qml
.
Object
}
}
...
...
wallet.qml
View file @
95a48cea
...
@@ -71,11 +71,30 @@ ApplicationWindow {
...
@@ -71,11 +71,30 @@ ApplicationWindow {
statusBar
:
StatusBar
{
statusBar
:
StatusBar
{
RowLayout
{
RowLayout
{
anchors.fill
:
parent
Label
{
text
:
"0.0.1"
}
Label
{
text
:
"0.0.1"
}
Label
{
anchors.right
:
peerImage
.
left
anchors.rightMargin
:
5
id
:
peerLabel
font.pixelSize
:
8
text
:
"0 / 0"
}
Image
{
id
:
peerImage
anchors.right
:
parent
.
right
width
:
10
;
height
:
10
source
:
"network.png"
}
}
}
}
}
function
addBlock
(
block
)
{
function
addBlock
(
block
)
{
blockModel
.
insert
(
0
,
{
number
:
block
.
number
,
hash
:
block
.
hash
})
blockModel
.
insert
(
0
,
{
number
:
block
.
number
,
hash
:
block
.
hash
})
}
}
function
setPeers
(
text
)
{
peerLabel
.
text
=
text
}
}
}
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