From c1474e1877641cb80ed0c935a3bd5b3d5c2fe3ac Mon Sep 17 00:00:00 2001 From: obscuren Date: Tue, 17 Feb 2015 23:10:37 +0100 Subject: Removed mined transactions from pending view. Closes #321 --- cmd/mist/gui.go | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'cmd/mist/gui.go') diff --git a/cmd/mist/gui.go b/cmd/mist/gui.go index c12538f4a..c9419473c 100644 --- a/cmd/mist/gui.go +++ b/cmd/mist/gui.go @@ -407,34 +407,10 @@ func (gui *Gui) update() { } switch ev := ev.(type) { case core.TxPreEvent: - tx := ev.Tx - - tstate := gui.eth.ChainManager().TransState() - cstate := gui.eth.ChainManager().State() - - taccount := tstate.GetAccount(gui.address()) - caccount := cstate.GetAccount(gui.address()) - unconfirmedFunds := new(big.Int).Sub(taccount.Balance(), caccount.Balance()) - - gui.setWalletValue(taccount.Balance(), unconfirmedFunds) - gui.insertTransaction("pre", tx) + gui.insertTransaction("pre", ev.Tx) case core.TxPostEvent: - tx := ev.Tx - object := state.GetAccount(gui.address()) - - if bytes.Compare(tx.From(), gui.address()) == 0 { - object.SubAmount(tx.Value()) - - gui.txDb.Put(tx.Hash(), tx.RlpEncode()) - } else if bytes.Compare(tx.To(), gui.address()) == 0 { - object.AddAmount(tx.Value()) - - gui.txDb.Put(tx.Hash(), tx.RlpEncode()) - } - - gui.setWalletValue(object.Balance(), nil) - state.UpdateStateObject(object) + gui.getObjectByName("pendingTxView").Call("removeTx", xeth.NewTx(ev.Tx)) } case <-peerUpdateTicker.C: -- cgit