aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-02-21 20:23:35 +0800
committerobscuren <geffobscura@gmail.com>2014-02-21 20:23:35 +0800
commit95a48cea18eccd4ea2cb298027dbd01bd21f43e8 (patch)
tree2a8352bd42a990c26de155fd8c30d9eca0064ed1 /ui
parentaaac0c9998ee78d796c1dbab118f721f886ce426 (diff)
downloaddexon-95a48cea18eccd4ea2cb298027dbd01bd21f43e8.tar.gz
dexon-95a48cea18eccd4ea2cb298027dbd01bd21f43e8.tar.zst
dexon-95a48cea18eccd4ea2cb298027dbd01bd21f43e8.zip
Peer amount update
Diffstat (limited to 'ui')
-rw-r--r--ui/gui.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/gui.go b/ui/gui.go
index aae1320fc..e223fe262 100644
--- a/ui/gui.go
+++ b/ui/gui.go
@@ -9,6 +9,7 @@ import (
"github.com/ethereum/eth-go/ethutil"
"github.com/niemeyer/qml"
"strings"
+ "time"
)
type Gui struct {
@@ -55,6 +56,7 @@ func (ui *Gui) Start() {
ui.eth.BlockManager.SecondaryBlockProcessor = ui
go ui.setInitialBlockChain()
+ go ui.updatePeers()
ui.win.Show()
ui.win.Wait()
@@ -73,6 +75,13 @@ func (ui *Gui) ProcessBlock(block *ethchain.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 {
root qml.Object
}