aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/mist
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-02-18 06:10:37 +0800
committerobscuren <geffobscura@gmail.com>2015-02-18 06:10:37 +0800
commitc1474e1877641cb80ed0c935a3bd5b3d5c2fe3ac (patch)
tree8ef60fc899da8a74f69060a2b7aa735feea9a237 /cmd/mist
parent26d58e0446521f725616b5a5d1b9d1ac04837f00 (diff)
downloaddexon-c1474e1877641cb80ed0c935a3bd5b3d5c2fe3ac.tar.gz
dexon-c1474e1877641cb80ed0c935a3bd5b3d5c2fe3ac.tar.zst
dexon-c1474e1877641cb80ed0c935a3bd5b3d5c2fe3ac.zip
Removed mined transactions from pending view. Closes #321
Diffstat (limited to 'cmd/mist')
-rw-r--r--cmd/mist/assets/qml/main.qml2
-rw-r--r--cmd/mist/assets/qml/views/pending_tx.qml9
-rw-r--r--cmd/mist/gui.go28
3 files changed, 12 insertions, 27 deletions
diff --git a/cmd/mist/assets/qml/main.qml b/cmd/mist/assets/qml/main.qml
index e194c9f09..3089fc46f 100644
--- a/cmd/mist/assets/qml/main.qml
+++ b/cmd/mist/assets/qml/main.qml
@@ -876,7 +876,7 @@ ApplicationWindow {
}
function setWalletValue(value) {
- walletValueLabel.text = value
+ //walletValueLabel.text = value
}
function loadPlugin(name) {
diff --git a/cmd/mist/assets/qml/views/pending_tx.qml b/cmd/mist/assets/qml/views/pending_tx.qml
index 4442a69db..3dcedeff2 100644
--- a/cmd/mist/assets/qml/views/pending_tx.qml
+++ b/cmd/mist/assets/qml/views/pending_tx.qml
@@ -41,4 +41,13 @@ Rectangle {
pendingTxModel.insert(0, {hash: tx.hash, to: tx.address, from: tx.sender, value: tx.value, contract: isContract})
}
+
+ function removeTx(tx) {
+ for (var i = 0; i < pendingTxModel.count; i++) {
+ if (tx.hash === pendingTxModel.get(i).hash) {
+ pendingTxModel.remove(i);
+ break;
+ }
+ }
+ }
}
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: