mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-26 05:27:19 +00:00
Updated Mist to use new blocks
This commit is contained in:
parent
9e5257b83b
commit
e2e3fa3d11
@ -221,7 +221,7 @@ func (gui *Gui) setInitialChain(ancientBlocks bool) {
|
|||||||
sBlk := gui.eth.ChainManager().LastBlockHash()
|
sBlk := gui.eth.ChainManager().LastBlockHash()
|
||||||
blk := gui.eth.ChainManager().GetBlock(sBlk)
|
blk := gui.eth.ChainManager().GetBlock(sBlk)
|
||||||
for ; blk != nil; 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)
|
gui.processBlock(blk, true)
|
||||||
}
|
}
|
||||||
@ -322,7 +322,7 @@ func (gui *Gui) readPreviousTransactions() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) processBlock(block *types.Block, initial bool) {
|
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 := xeth.NewJSBlock(block)
|
||||||
b.Name = name
|
b.Name = name
|
||||||
|
|
||||||
@ -400,7 +400,7 @@ func (gui *Gui) update() {
|
|||||||
switch ev := ev.(type) {
|
switch ev := ev.(type) {
|
||||||
case core.NewBlockEvent:
|
case core.NewBlockEvent:
|
||||||
gui.processBlock(ev.Block, false)
|
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)
|
gui.setWalletValue(gui.eth.ChainManager().State().GetBalance(gui.address()), nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,7 +438,7 @@ func (gui *Gui) update() {
|
|||||||
case <-peerUpdateTicker.C:
|
case <-peerUpdateTicker.C:
|
||||||
gui.setPeerInfo()
|
gui.setPeerInfo()
|
||||||
case <-generalUpdateTicker.C:
|
case <-generalUpdateTicker.C:
|
||||||
statusText := "#" + gui.eth.ChainManager().CurrentBlock().Number.String()
|
statusText := "#" + gui.eth.ChainManager().CurrentBlock().Number().String()
|
||||||
lastBlockLabel.Set("text", statusText)
|
lastBlockLabel.Set("text", statusText)
|
||||||
miningLabel.Set("text", "Mining @ "+strconv.FormatInt(gui.uiLib.miner.GetPow().GetHashrate(), 10)+"Khash")
|
miningLabel.Set("text", "Mining @ "+strconv.FormatInt(gui.uiLib.miner.GetPow().GetHashrate(), 10)+"Khash")
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ func (app *HtmlApplication) Window() *qml.Window {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (app *HtmlApplication) NewBlock(block *types.Block) {
|
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)
|
app.webView.Call("onNewBlockCb", b)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ func (app *QmlApplication) NewWatcher(quitChan chan bool) {
|
|||||||
|
|
||||||
// Events
|
// Events
|
||||||
func (app *QmlApplication) NewBlock(block *types.Block) {
|
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)
|
app.win.Call("onNewBlockCb", pblock)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user