aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/ui
diff options
context:
space:
mode:
authorMaran <maran.hidskes@gmail.com>2014-06-02 21:16:37 +0800
committerMaran <maran.hidskes@gmail.com>2014-06-02 21:16:37 +0800
commita6f4eef1dadee9d8caa9b0ac20e2ce4a3034a100 (patch)
treeca1602b7945cc32f3a6b0008225f2767db29bb48 /ethereal/ui
parent98811f11e5d7ccf6e053b46b9ca2ed897140ce47 (diff)
downloadgo-tangerine-a6f4eef1dadee9d8caa9b0ac20e2ce4a3034a100.tar
go-tangerine-a6f4eef1dadee9d8caa9b0ac20e2ce4a3034a100.tar.gz
go-tangerine-a6f4eef1dadee9d8caa9b0ac20e2ce4a3034a100.tar.bz2
go-tangerine-a6f4eef1dadee9d8caa9b0ac20e2ce4a3034a100.tar.lz
go-tangerine-a6f4eef1dadee9d8caa9b0ac20e2ce4a3034a100.tar.xz
go-tangerine-a6f4eef1dadee9d8caa9b0ac20e2ce4a3034a100.tar.zst
go-tangerine-a6f4eef1dadee9d8caa9b0ac20e2ce4a3034a100.zip
Added Peer Window
Diffstat (limited to 'ethereal/ui')
-rw-r--r--ethereal/ui/gui.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go
index 44215efdb..db06add8e 100644
--- a/ethereal/ui/gui.go
+++ b/ethereal/ui/gui.go
@@ -12,6 +12,7 @@ import (
"github.com/go-qml/qml"
"math/big"
"strings"
+ "time"
)
type Gui struct {
@@ -91,7 +92,7 @@ func (gui *Gui) Start(assetPath string) {
ethutil.Config.Log.AddLogSystem(gui)
}
if err != nil {
- ethutil.Config.Log.Infoln("FATAL: asset not found: you can set an alternative asset path on on the command line using option 'asset_path'")
+ ethutil.Config.Log.Infoln("FATAL: asset not found: you can set an alternative asset path on on the command line using option 'asset_path'", err)
panic(err)
}
@@ -235,6 +236,8 @@ func (gui *Gui) update() {
reactor.Subscribe("object:"+string(namereg), objectChan)
reactor.Subscribe("peerList", peerChan)
+ ticker := time.NewTicker(5 * time.Second)
+
state := gui.eth.StateManager().TransState()
unconfirmedFunds := new(big.Int)
@@ -284,12 +287,19 @@ func (gui *Gui) update() {
gui.loadAddressBook()
case <-peerChan:
gui.setPeerInfo()
+ case <-ticker.C:
+ gui.setPeerInfo()
}
}
}
func (gui *Gui) setPeerInfo() {
gui.win.Root().Call("setPeers", fmt.Sprintf("%d / %d", gui.eth.PeerCount(), gui.eth.MaxPeers))
+
+ gui.win.Root().Call("resetPeers")
+ for _, peer := range gui.pub.GetPeers() {
+ gui.win.Root().Call("addPeer", peer)
+ }
}
// Logging functions that log directly to the GUI interface