aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/ui/gui.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-27 22:11:01 +0800
committerobscuren <geffobscura@gmail.com>2014-05-27 22:11:01 +0800
commit0dda955f90b674090066d3621b40eabba14f8559 (patch)
treeb7f8bcd5f65531986c6412e0a71df0a7d6a50c04 /ethereal/ui/gui.go
parent0d89c1d212e121b4904bf24b5332de9d4344334b (diff)
parent34b861c19c02947503a175f7b2be6c880a007d11 (diff)
downloaddexon-0dda955f90b674090066d3621b40eabba14f8559.tar
dexon-0dda955f90b674090066d3621b40eabba14f8559.tar.gz
dexon-0dda955f90b674090066d3621b40eabba14f8559.tar.bz2
dexon-0dda955f90b674090066d3621b40eabba14f8559.tar.lz
dexon-0dda955f90b674090066d3621b40eabba14f8559.tar.xz
dexon-0dda955f90b674090066d3621b40eabba14f8559.tar.zst
dexon-0dda955f90b674090066d3621b40eabba14f8559.zip
Merge branch 'release/poc5-rc10'
Diffstat (limited to 'ethereal/ui/gui.go')
-rw-r--r--ethereal/ui/gui.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go
index 8d6796ddb..63ab028ab 100644
--- a/ethereal/ui/gui.go
+++ b/ethereal/ui/gui.go
@@ -54,7 +54,7 @@ func New(ethereum *eth.Ethereum) *Gui {
}
func (gui *Gui) Start(assetPath string) {
- const version = "0.5.0 RC9"
+ const version = "0.5.0 RC10"
defer gui.txDb.Close()
@@ -130,20 +130,19 @@ func (gui *Gui) createWindow(comp qml.Object) *qml.Window {
gui.win = win
gui.uiLib.win = win
- db := &Debugger{gui.win, make(chan bool)}
+ db := &Debugger{gui.win, make(chan bool), make(chan bool), true}
gui.lib.Db = db
gui.uiLib.Db = db
return gui.win
}
-
func (gui *Gui) setInitialBlockChain() {
- // Load previous 10 blocks
- chain := gui.eth.BlockChain().GetChain(gui.eth.BlockChain().CurrentBlock.Hash(), 10)
- for _, block := range chain {
- gui.processBlock(block)
+ sBlk := gui.eth.BlockChain().LastBlockHash
+ blk := gui.eth.BlockChain().GetBlock(sBlk)
+ for ; blk != nil; blk = gui.eth.BlockChain().GetBlock(sBlk) {
+ sBlk = blk.PrevHash
+ gui.processBlock(blk, true)
}
-
}
func (gui *Gui) readPreviousTransactions() {
@@ -164,8 +163,8 @@ func (gui *Gui) readPreviousTransactions() {
it.Release()
}
-func (gui *Gui) processBlock(block *ethchain.Block) {
- gui.win.Root().Call("addBlock", ethpub.NewPBlock(block))
+func (gui *Gui) processBlock(block *ethchain.Block, initial bool) {
+ gui.win.Root().Call("addBlock", ethpub.NewPBlock(block), initial)
}
func (gui *Gui) setWalletValue(amount, unconfirmedFunds *big.Int) {
@@ -204,6 +203,7 @@ func (gui *Gui) update() {
select {
case b := <-blockChan:
block := b.Resource.(*ethchain.Block)
+ gui.processBlock(block, false)
if bytes.Compare(block.Coinbase, gui.addr) == 0 {
gui.setWalletValue(gui.eth.StateManager().CurrentState().GetAccount(gui.addr).Amount, nil)
}