From 3a2bddc160ece4dcb6d2d5bcc85091d244e774c0 Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 15 May 2014 14:06:06 +0200 Subject: Refactored to reactor. Fixes #42 --- ethereal/ui/gui.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'ethereal/ui/gui.go') diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go index aa0364998..c4cc1373f 100644 --- a/ethereal/ui/gui.go +++ b/ethereal/ui/gui.go @@ -178,13 +178,14 @@ func (gui *Gui) setWalletValue(amount, unconfirmedFunds *big.Int) { // Simple go routine function that updates the list of peers in the GUI func (gui *Gui) update() { - blockChan := make(chan ethutil.React, 1) reactor := gui.eth.Reactor() - reactor.Subscribe("newBlock", blockChan) + blockChan := make(chan ethutil.React, 1) + txChan := make(chan ethutil.React, 1) - txChan := make(chan ethchain.TxMsg, 1) - gui.eth.TxPool().Subscribe(txChan) + reactor.Subscribe("newBlock", blockChan) + reactor.Subscribe("newTx:pre", txChan) + reactor.Subscribe("newTx:post", txChan) state := gui.eth.StateManager().TransState() @@ -200,9 +201,9 @@ func (gui *Gui) update() { } case txMsg := <-txChan: - tx := txMsg.Tx + tx := txMsg.Resource.(*ethchain.Transaction) - if txMsg.Type == ethchain.TxPre { + if txMsg.Event == "newTx:pre" { object := state.GetAccount(gui.addr) if bytes.Compare(tx.Sender(), gui.addr) == 0 && object.Nonce <= tx.Nonce { -- cgit v1.2.3 From 770808ce0d44cadfedbe01694c836be2eaf0e82c Mon Sep 17 00:00:00 2001 From: obscuren Date: Sat, 17 May 2014 15:15:46 +0200 Subject: Readline repl for linux & osx --- ethereal/ui/gui.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ethereal/ui/gui.go') diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go index c4cc1373f..24be9e0c5 100644 --- a/ethereal/ui/gui.go +++ b/ethereal/ui/gui.go @@ -197,7 +197,7 @@ func (gui *Gui) update() { case b := <-blockChan: block := b.Resource.(*ethchain.Block) if bytes.Compare(block.Coinbase, gui.addr) == 0 { - gui.setWalletValue(gui.eth.StateManager().ProcState().GetAccount(gui.addr).Amount, nil) + gui.setWalletValue(gui.eth.StateManager().CurrentState().GetAccount(gui.addr).Amount, nil) } case txMsg := <-txChan: -- cgit v1.2.3 From 43f88b2bbb6fc993f8bfee531056a7e11bef59bd Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 19 May 2014 12:14:32 +0200 Subject: Removed nonce incrementing --- ethereal/ui/gui.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ethereal/ui/gui.go') diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go index 24be9e0c5..e465d5273 100644 --- a/ethereal/ui/gui.go +++ b/ethereal/ui/gui.go @@ -210,8 +210,10 @@ func (gui *Gui) update() { gui.win.Root().Call("addTx", ethpub.NewPTx(tx)) gui.txDb.Put(tx.Hash(), tx.RlpEncode()) - object.Nonce += 1 - state.SetStateObject(object) + /* + object.Nonce += 1 + state.SetStateObject(object) + */ unconfirmedFunds.Sub(unconfirmedFunds, tx.Value) } else if bytes.Compare(tx.Recipient, gui.addr) == 0 { -- cgit v1.2.3 From 34014c1c516ea03b28e56db1a0478087d2416f74 Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 20 May 2014 17:08:23 +0200 Subject: Bump --- ethereal/ui/gui.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ethereal/ui/gui.go') diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go index e465d5273..e267dabfd 100644 --- a/ethereal/ui/gui.go +++ b/ethereal/ui/gui.go @@ -55,7 +55,7 @@ func New(ethereum *eth.Ethereum) *Gui { } func (gui *Gui) Start(assetPath string) { - const version = "0.5.0 RC6" + const version = "0.5.0 RC7" defer gui.txDb.Close() -- cgit v1.2.3