Skip to content

Commit

Permalink
Fixed wallet crash for new account. Fixes #38
Browse files Browse the repository at this point in the history
  • Loading branch information
obscuren committed May 13, 2014
1 parent c3ad210 commit 8c9e674
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ethereal/ui/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,15 @@ func (gui *Gui) update() {
state := gui.eth.StateManager().TransState()

unconfirmedFunds := new(big.Int)
gui.win.Root().Call("setWalletValue", fmt.Sprintf("%v", ethutil.CurrencyToString(state.GetStateObject(gui.addr).Amount)))
gui.win.Root().Call("setWalletValue", fmt.Sprintf("%v", ethutil.CurrencyToString(state.GetAccount(gui.addr).Amount)))

for {
select {
case txMsg := <-txChan:
tx := txMsg.Tx

if txMsg.Type == ethchain.TxPre {
object := state.GetStateObject(gui.addr)
object := state.GetAccount(gui.addr)

if bytes.Compare(tx.Sender(), gui.addr) == 0 && object.Nonce <= tx.Nonce {
gui.win.Root().Call("addTx", ethpub.NewPTx(tx))
Expand All @@ -241,7 +241,7 @@ func (gui *Gui) update() {

gui.win.Root().Call("setWalletValue", str)
} else {
object := state.GetStateObject(gui.addr)
object := state.GetAccount(gui.addr)
if bytes.Compare(tx.Sender(), gui.addr) == 0 {
object.SubAmount(tx.Value)
} else if bytes.Compare(tx.Recipient, gui.addr) == 0 {
Expand Down

0 comments on commit 8c9e674

Please sign in to comment.