Skip to content

Commit

Permalink
fixed logging issue that would otherwise crash the client. Fixes #68
Browse files Browse the repository at this point in the history
  • Loading branch information
obscuren committed May 31, 2014
1 parent 397e99f commit d6acb74
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions ethereal/ui/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,18 @@ func (gui *Gui) Start(assetPath string) {
win, err = gui.showKeyImport(context)
} else {
win, err = gui.showWallet(context)

ethutil.Config.Log.AddLogSystem(gui)
}
if err != nil {
ethutil.Config.Log.Infoln("FATAL: asset not found: you can set an alternative asset path on on the command line using option 'asset_path'")

panic(err)
}

win.Show()

ethutil.Config.Log.AddLogSystem(gui)
ethutil.Config.Log.Infoln("[GUI] Starting GUI")

win.Show()
win.Wait()

gui.eth.Stop()
Expand Down Expand Up @@ -174,9 +174,12 @@ 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())})
})
stateObject := gui.eth.StateManager().CurrentState().GetStateObject(namereg)
if stateObject != nil {
stateObject.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() {
Expand Down

0 comments on commit d6acb74

Please sign in to comment.