diff options
author | obscuren <geffobscura@gmail.com> | 2014-02-21 20:06:17 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-02-21 20:06:17 +0800 |
commit | aaac0c9998ee78d796c1dbab118f721f886ce426 (patch) | |
tree | 9d477a5bbb597ff707e6625ce25c0e96b9af04dd /ui | |
parent | 05c353eca0c4e01457412dd643529200816ab159 (diff) | |
download | dexon-aaac0c9998ee78d796c1dbab118f721f886ce426.tar dexon-aaac0c9998ee78d796c1dbab118f721f886ce426.tar.gz dexon-aaac0c9998ee78d796c1dbab118f721f886ce426.tar.bz2 dexon-aaac0c9998ee78d796c1dbab118f721f886ce426.tar.lz dexon-aaac0c9998ee78d796c1dbab118f721f886ce426.tar.xz dexon-aaac0c9998ee78d796c1dbab118f721f886ce426.tar.zst dexon-aaac0c9998ee78d796c1dbab118f721f886ce426.zip |
Initial block chain fetching of existing blocks
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gui.go | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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)) } |