aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ui/gui.go12
-rw-r--r--wallet.qml2
2 files changed, 12 insertions, 2 deletions
diff --git a/ui/gui.go b/ui/gui.go
index b2a8dad73..aae1320fc 100644
--- a/ui/gui.go
+++ b/ui/gui.go
@@ -53,12 +53,22 @@ func (ui *Gui) Start() {
context.SetVar("tester", &Tester{root: root})
ui.eth.BlockManager.SecondaryBlockProcessor = ui
- ui.eth.Start()
+
+ go ui.setInitialBlockChain()
ui.win.Show()
ui.win.Wait()
}
+func (ui *Gui) setInitialBlockChain() {
+ chain := ui.eth.BlockManager.BlockChain().GetChain(ui.eth.BlockManager.BlockChain().CurrentBlock.Hash(), 10)
+ for _, block := range chain {
+ ui.ProcessBlock(block)
+ }
+
+ ui.eth.Start()
+}
+
func (ui *Gui) ProcessBlock(block *ethchain.Block) {
ui.win.Root().Call("addBlock", NewBlockFromBlock(block))
}
diff --git a/wallet.qml b/wallet.qml
index 2bf4e4576..cbce7ebcc 100644
--- a/wallet.qml
+++ b/wallet.qml
@@ -76,6 +76,6 @@ ApplicationWindow {
}
function addBlock(block) {
- blockModel.append({number: block.number, hash: block.hash})
+ blockModel.insert(0, {number: block.number, hash: block.hash})
}
}