Minor GUI updates

* IceCream => IceCREAM
* Added coin base to block info
This commit is contained in:
obscuren
2014-05-30 11:50:30 +02:00
parent 40d72ff40b
commit fcbf99a30a
3 changed files with 49 additions and 36 deletions

View File

@ -110,6 +110,7 @@ func (gui *Gui) showWallet(context *qml.Context) (*qml.Window, error) {
win := gui.createWindow(component)
go gui.setInitialBlockChain()
go gui.loadAddressBook()
go gui.readPreviousTransactions()
go gui.update()
@ -147,6 +148,19 @@ func (gui *Gui) setInitialBlockChain() {
}
}
type address struct {
Name, Address string
}
var namereg = ethutil.FromHex("bb5f186604d057c1c5240ca2ae0f6430138ac010")
func (gui *Gui) loadAddressBook() {
gui.win.Root().Call("clearAddress")
gui.eth.StateManager().CurrentState().GetStateObject(namereg).State().EachStorage(func(name string, value *ethutil.Value) {
gui.win.Root().Call("addAddress", struct{ Name, Address string }{name, ethutil.Hex(value.Bytes())})
})
}
func (gui *Gui) readPreviousTransactions() {
it := gui.txDb.Db().NewIterator(nil, nil)
for it.Next() {
@ -191,10 +205,12 @@ func (gui *Gui) update() {
blockChan := make(chan ethutil.React, 1)
txChan := make(chan ethutil.React, 1)
objectChan := make(chan ethutil.React, 1)
reactor.Subscribe("newBlock", blockChan)
reactor.Subscribe("newTx:pre", txChan)
reactor.Subscribe("newTx:post", txChan)
reactor.Subscribe("object:"+string(namereg), objectChan)
state := gui.eth.StateManager().TransState()
@ -241,6 +257,8 @@ func (gui *Gui) update() {
state.UpdateStateObject(object)
}
case <-objectChan:
gui.loadAddressBook()
}
}
}