From 82a84dca807c8966079253977329ef0800d20557 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 24 Jul 2014 14:16:43 +0200 Subject: Move to goroutine for faster startup time --- ethereal/gui.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ethereal/gui.go') diff --git a/ethereal/gui.go b/ethereal/gui.go index d76db2ade..df01cddda 100644 --- a/ethereal/gui.go +++ b/ethereal/gui.go @@ -143,10 +143,12 @@ func (gui *Gui) showWallet(context *qml.Context) (*qml.Window, error) { win := gui.createWindow(component) - gui.setInitialBlockChain() - gui.loadAddressBook() - gui.readPreviousTransactions() - gui.setPeerInfo() + go func() { + gui.setInitialBlockChain() + gui.loadAddressBook() + gui.readPreviousTransactions() + gui.setPeerInfo() + }() go gui.update() -- cgit v1.2.3 From 97004f7eb22ab30ba1acc5dd3ee2f17b5466d41a Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 25 Jul 2014 10:41:57 +0200 Subject: wip export --- ethereal/gui.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'ethereal/gui.go') diff --git a/ethereal/gui.go b/ethereal/gui.go index df01cddda..832200176 100644 --- a/ethereal/gui.go +++ b/ethereal/gui.go @@ -155,6 +155,9 @@ func (gui *Gui) showWallet(context *qml.Context) (*qml.Window, error) { return win, nil } +func (gui *Gui) ImportKey(filePath string) { +} + func (gui *Gui) showKeyImport(context *qml.Context) (*qml.Window, error) { context.SetVar("lib", gui) component, err := gui.engine.LoadFile(gui.uiLib.AssetPath("qml/first_run.qml")) -- cgit v1.2.3 From 5c9fd19105c572ea717a8bc04758dcf3e71af47e Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 30 Jul 2014 00:17:23 +0200 Subject: A few start up optimisations --- ethereal/gui.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ethereal/gui.go') diff --git a/ethereal/gui.go b/ethereal/gui.go index 832200176..573f68959 100644 --- a/ethereal/gui.go +++ b/ethereal/gui.go @@ -144,10 +144,10 @@ func (gui *Gui) showWallet(context *qml.Context) (*qml.Window, error) { win := gui.createWindow(component) go func() { - gui.setInitialBlockChain() + go gui.setInitialBlockChain() gui.loadAddressBook() - gui.readPreviousTransactions() gui.setPeerInfo() + gui.readPreviousTransactions() }() go gui.update() -- cgit v1.2.3 From 719b7784f38a8ee6158d4d5a9230a98041f140b1 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 30 Jul 2014 00:30:57 +0200 Subject: Renamed to balance --- ethereal/gui.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'ethereal/gui.go') diff --git a/ethereal/gui.go b/ethereal/gui.go index 573f68959..31d4248b2 100644 --- a/ethereal/gui.go +++ b/ethereal/gui.go @@ -3,6 +3,11 @@ package main import ( "bytes" "fmt" + "math/big" + "strconv" + "strings" + "time" + "github.com/ethereum/eth-go" "github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethdb" @@ -13,10 +18,6 @@ import ( "github.com/ethereum/eth-go/ethwire" "github.com/ethereum/go-ethereum/utils" "github.com/go-qml/qml" - "math/big" - "strconv" - "strings" - "time" ) var logger = ethlog.NewLogger("GUI") @@ -313,7 +314,7 @@ func (gui *Gui) update() { state := gui.eth.StateManager().TransState() unconfirmedFunds := new(big.Int) - gui.win.Root().Call("setWalletValue", fmt.Sprintf("%v", ethutil.CurrencyToString(state.GetAccount(gui.address()).Amount))) + gui.win.Root().Call("setWalletValue", fmt.Sprintf("%v", ethutil.CurrencyToString(state.GetAccount(gui.address()).Balance))) gui.getObjectByName("syncProgressIndicator").Set("visible", !gui.eth.IsUpToDate()) lastBlockLabel := gui.getObjectByName("lastBlockLabel") @@ -324,7 +325,7 @@ func (gui *Gui) update() { block := b.Resource.(*ethchain.Block) gui.processBlock(block, false) if bytes.Compare(block.Coinbase, gui.address()) == 0 { - gui.setWalletValue(gui.eth.StateManager().CurrentState().GetAccount(gui.address()).Amount, nil) + gui.setWalletValue(gui.eth.StateManager().CurrentState().GetAccount(gui.address()).Balance, nil) } case txMsg := <-txChan: @@ -345,7 +346,7 @@ func (gui *Gui) update() { unconfirmedFunds.Add(unconfirmedFunds, tx.Value) } - gui.setWalletValue(object.Amount, unconfirmedFunds) + gui.setWalletValue(object.Balance, unconfirmedFunds) } else { object := state.GetAccount(gui.address()) if bytes.Compare(tx.Sender(), gui.address()) == 0 { @@ -354,7 +355,7 @@ func (gui *Gui) update() { object.AddAmount(tx.Value) } - gui.setWalletValue(object.Amount, nil) + gui.setWalletValue(object.Balance, nil) state.UpdateStateObject(object) } -- cgit v1.2.3