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
0938b568
Commit
0938b568
authored
May 30, 2014
by
obscuren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update peer info
parent
fcbf99a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
gui.go
ethereal/ui/gui.go
+13
-3
No files found.
ethereal/ui/gui.go
View file @
0938b568
...
...
@@ -109,9 +109,11 @@ func (gui *Gui) showWallet(context *qml.Context) (*qml.Window, error) {
win
:=
gui
.
createWindow
(
component
)
go
gui
.
setInitialBlockChain
()
go
gui
.
loadAddressBook
()
go
gui
.
readPreviousTransactions
()
gui
.
setInitialBlockChain
()
gui
.
loadAddressBook
()
gui
.
readPreviousTransactions
()
gui
.
setPeerInfo
()
go
gui
.
update
()
return
win
,
nil
...
...
@@ -206,11 +208,13 @@ func (gui *Gui) update() {
blockChan
:=
make
(
chan
ethutil
.
React
,
1
)
txChan
:=
make
(
chan
ethutil
.
React
,
1
)
objectChan
:=
make
(
chan
ethutil
.
React
,
1
)
peerChan
:=
make
(
chan
ethutil
.
React
,
1
)
reactor
.
Subscribe
(
"newBlock"
,
blockChan
)
reactor
.
Subscribe
(
"newTx:pre"
,
txChan
)
reactor
.
Subscribe
(
"newTx:post"
,
txChan
)
reactor
.
Subscribe
(
"object:"
+
string
(
namereg
),
objectChan
)
reactor
.
Subscribe
(
"peerList"
,
peerChan
)
state
:=
gui
.
eth
.
StateManager
()
.
TransState
()
...
...
@@ -259,10 +263,16 @@ func (gui *Gui) update() {
}
case
<-
objectChan
:
gui
.
loadAddressBook
()
case
<-
peerChan
:
gui
.
setPeerInfo
()
}
}
}
func
(
gui
*
Gui
)
setPeerInfo
()
{
gui
.
win
.
Root
()
.
Call
(
"setPeers"
,
fmt
.
Sprintf
(
"%d / %d"
,
gui
.
eth
.
PeerCount
(),
gui
.
eth
.
MaxPeers
))
}
// Logging functions that log directly to the GUI interface
func
(
gui
*
Gui
)
Println
(
v
...
interface
{})
{
str
:=
strings
.
TrimRight
(
fmt
.
Sprintln
(
v
...
),
"
\n
"
)
...
...
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