From e2e3fa3d11b37c8a22ebafe9c02dfd8089ac4d51 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 23 Dec 2014 14:44:45 +0100 Subject: Updated Mist to use new blocks --- cmd/mist/gui.go | 8 ++++---- cmd/mist/html_container.go | 2 +- cmd/mist/qml_container.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'cmd') diff --git a/cmd/mist/gui.go b/cmd/mist/gui.go index 1152f0dcd..e5e18bbaa 100644 --- a/cmd/mist/gui.go +++ b/cmd/mist/gui.go @@ -221,7 +221,7 @@ func (gui *Gui) setInitialChain(ancientBlocks bool) { sBlk := gui.eth.ChainManager().LastBlockHash() blk := gui.eth.ChainManager().GetBlock(sBlk) for ; blk != nil; blk = gui.eth.ChainManager().GetBlock(sBlk) { - sBlk = blk.PrevHash + sBlk = blk.ParentHash() gui.processBlock(blk, true) } @@ -322,7 +322,7 @@ func (gui *Gui) readPreviousTransactions() { } func (gui *Gui) processBlock(block *types.Block, initial bool) { - name := strings.Trim(gui.pipe.World().Config().Get("NameReg").Storage(block.Coinbase).Str(), "\x00") + name := strings.Trim(gui.pipe.World().Config().Get("NameReg").Storage(block.Coinbase()).Str(), "\x00") b := xeth.NewJSBlock(block) b.Name = name @@ -400,7 +400,7 @@ func (gui *Gui) update() { switch ev := ev.(type) { case core.NewBlockEvent: gui.processBlock(ev.Block, false) - if bytes.Compare(ev.Block.Coinbase, gui.address()) == 0 { + if bytes.Compare(ev.Block.Coinbase(), gui.address()) == 0 { gui.setWalletValue(gui.eth.ChainManager().State().GetBalance(gui.address()), nil) } @@ -438,7 +438,7 @@ func (gui *Gui) update() { case <-peerUpdateTicker.C: gui.setPeerInfo() case <-generalUpdateTicker.C: - statusText := "#" + gui.eth.ChainManager().CurrentBlock().Number.String() + statusText := "#" + gui.eth.ChainManager().CurrentBlock().Number().String() lastBlockLabel.Set("text", statusText) miningLabel.Set("text", "Mining @ "+strconv.FormatInt(gui.uiLib.miner.GetPow().GetHashrate(), 10)+"Khash") diff --git a/cmd/mist/html_container.go b/cmd/mist/html_container.go index b3fc219fa..bd11ccd57 100644 --- a/cmd/mist/html_container.go +++ b/cmd/mist/html_container.go @@ -139,7 +139,7 @@ func (app *HtmlApplication) Window() *qml.Window { } func (app *HtmlApplication) NewBlock(block *types.Block) { - b := &xeth.JSBlock{Number: int(block.BlockInfo().Number), Hash: ethutil.Bytes2Hex(block.Hash())} + b := &xeth.JSBlock{Number: int(block.NumberU64()), Hash: ethutil.Bytes2Hex(block.Hash())} app.webView.Call("onNewBlockCb", b) } diff --git a/cmd/mist/qml_container.go b/cmd/mist/qml_container.go index a0a46f9b1..ed24737d0 100644 --- a/cmd/mist/qml_container.go +++ b/cmd/mist/qml_container.go @@ -66,7 +66,7 @@ func (app *QmlApplication) NewWatcher(quitChan chan bool) { // Events func (app *QmlApplication) NewBlock(block *types.Block) { - pblock := &xeth.JSBlock{Number: int(block.BlockInfo().Number), Hash: ethutil.Bytes2Hex(block.Hash())} + pblock := &xeth.JSBlock{Number: int(block.NumberU64()), Hash: ethutil.Bytes2Hex(block.Hash())} app.win.Call("onNewBlockCb", pblock) } -- cgit v1.2.3