aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ethereal/ui/gui.go13
1 files changed, 7 insertions, 6 deletions
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 {