aboutsummaryrefslogtreecommitdiffstats
path: root/ethereal/ui
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-30 17:50:30 +0800
committerobscuren <geffobscura@gmail.com>2014-05-30 17:50:30 +0800
commitfcbf99a30a15b445c35d70a8a781190a2739845b (patch)
tree614d98187708a8b9a029539a9c063eb2b9314fbb /ethereal/ui
parent40d72ff40bac19bb1b51bd1d382e75438673dbf2 (diff)
downloadgo-tangerine-fcbf99a30a15b445c35d70a8a781190a2739845b.tar
go-tangerine-fcbf99a30a15b445c35d70a8a781190a2739845b.tar.gz
go-tangerine-fcbf99a30a15b445c35d70a8a781190a2739845b.tar.bz2
go-tangerine-fcbf99a30a15b445c35d70a8a781190a2739845b.tar.lz
go-tangerine-fcbf99a30a15b445c35d70a8a781190a2739845b.tar.xz
go-tangerine-fcbf99a30a15b445c35d70a8a781190a2739845b.tar.zst
go-tangerine-fcbf99a30a15b445c35d70a8a781190a2739845b.zip
Minor GUI updates
* IceCream => IceCREAM * Added coin base to block info
Diffstat (limited to 'ethereal/ui')
-rw-r--r--ethereal/ui/gui.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go
index 9a8673a1c..d08c1b118 100644
--- a/ethereal/ui/gui.go
+++ b/ethereal/ui/gui.go
@@ -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()
}
}
}