diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-14 19:55:08 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-14 19:55:08 +0800 |
commit | f18ec51cb3959cc662bfc7b84314cd1d3b1541b5 (patch) | |
tree | 1c3d99407624dc791db0cb6c135bd2bd1dfc56cf /ethereal/ui/gui.go | |
parent | e8147cf7c6f508910698e6743ad347c78010ffe3 (diff) | |
download | go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar.gz go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar.bz2 go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar.lz go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar.xz go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.tar.zst go-tangerine-f18ec51cb3959cc662bfc7b84314cd1d3b1541b5.zip |
Switched to new keyring methods
Diffstat (limited to 'ethereal/ui/gui.go')
-rw-r--r-- | ethereal/ui/gui.go | 49 |
1 files changed, 4 insertions, 45 deletions
diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go index 7f84272d6..396447a81 100644 --- a/ethereal/ui/gui.go +++ b/ethereal/ui/gui.go @@ -42,15 +42,11 @@ func New(ethereum *eth.Ethereum) *Gui { panic(err) } - data, _ := ethutil.Config.Db.Get([]byte("KeyRing")) // On first run we won't have any keys yet, so this would crash. // Therefor we check if we are ready to actually start this process var addr []byte - if len(data) > 0 { - key := ethutil.Config.Db.GetKeys()[0] - addr = key.Address() - - //ethereum.StateManager().WatchAddr(addr) + if ethutil.GetKeyRing().Len() != 0 { + addr = ethutil.GetKeyRing().Get(0).Address() } pub := ethpub.NewPEthereum(ethereum) @@ -81,43 +77,6 @@ func (gui *Gui) Start(assetPath string) { // Load the main QML interface data, _ := ethutil.Config.Db.Get([]byte("KeyRing")) - /* - var err error - var component qml.Object - firstRun := len(data) == 0 - - if firstRun { - component, err = gui.engine.LoadFile(uiLib.AssetPath("qml/first_run.qml")) - } else { - component, err = gui.engine.LoadFile(uiLib.AssetPath("qml/wallet.qml")) - } - 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) - } - - gui.win = component.CreateWindow(nil) - uiLib.win = gui.win - db := &Debugger{gui.win, make(chan bool)} - gui.lib.Db = db - uiLib.Db = db - - // Add the ui as a log system so we can log directly to the UGI - ethutil.Config.Log.AddLogSystem(gui) - - // Loads previous blocks - if firstRun == false { - go gui.setInitialBlockChain() - go gui.readPreviousTransactions() - go gui.update() - } - - gui.win.Show() - gui.win.Wait() - - gui.eth.Stop() - */ var win *qml.Window var err error @@ -274,13 +233,13 @@ func (gui *Gui) Printf(format string, v ...interface{}) { } func (gui *Gui) Transact(recipient, value, gas, gasPrice, data string) (*ethpub.PReceipt, error) { - keyPair := ethutil.Config.Db.GetKeys()[0] + keyPair := ethutil.GetKeyRing().Get(0) return gui.pub.Transact(ethutil.Hex(keyPair.PrivateKey), recipient, value, gas, gasPrice, data) } func (gui *Gui) Create(recipient, value, gas, gasPrice, data string) (*ethpub.PReceipt, error) { - keyPair := ethutil.Config.Db.GetKeys()[0] + keyPair := ethutil.GetKeyRing().Get(0) mainInput, initInput := mutan.PreParse(data) |