aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/ui
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-27 19:31:57 +0800
committerobscuren <geffobscura@gmail.com>2014-05-27 19:31:57 +0800
commit2be98230105ef402d26e8726cec2240770a9837f (patch)
treebbd3c9eef4cba01c95ed09f13d821c7d9a37dff6 /ethereal/ui
parent47417506c377dd0848739473fa14a51708b6a034 (diff)
parent6fe42f007c6f4816de88a2c4aad10754036d41b8 (diff)
downloaddexon-2be98230105ef402d26e8726cec2240770a9837f.tar
dexon-2be98230105ef402d26e8726cec2240770a9837f.tar.gz
dexon-2be98230105ef402d26e8726cec2240770a9837f.tar.bz2
dexon-2be98230105ef402d26e8726cec2240770a9837f.tar.lz
dexon-2be98230105ef402d26e8726cec2240770a9837f.tar.xz
dexon-2be98230105ef402d26e8726cec2240770a9837f.tar.zst
dexon-2be98230105ef402d26e8726cec2240770a9837f.zip
Merge branch 'develop' of github.com-obscure:ethereum/go-ethereum into develop
Conflicts: ethereal/assets/qml/wallet.qml
Diffstat (limited to 'ethereal/ui')
-rw-r--r--ethereal/ui/gui.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go
index ca6da5c49..b49fafac1 100644
--- a/ethereal/ui/gui.go
+++ b/ethereal/ui/gui.go
@@ -136,14 +136,13 @@ func (gui *Gui) createWindow(comp qml.Object) *qml.Window {
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)
}