diff options
Diffstat (limited to 'cmd/mist')
-rw-r--r-- | cmd/mist/assets/examples/coin.html | 5 | ||||
-rw-r--r-- | cmd/mist/assets/examples/info.html | 4 | ||||
-rw-r--r-- | cmd/mist/assets/ext/ethereum.js/dist/ethereum.js | 2 | ||||
-rw-r--r-- | cmd/mist/assets/qml/main.qml | 3 | ||||
-rw-r--r-- | cmd/mist/assets/qml/views/pending_tx.qml | 9 | ||||
-rw-r--r-- | cmd/mist/gui.go | 36 | ||||
-rw-r--r-- | cmd/mist/main.go | 1 |
7 files changed, 19 insertions, 41 deletions
diff --git a/cmd/mist/assets/examples/coin.html b/cmd/mist/assets/examples/coin.html index ca7a9c0dd..cb9d471de 100644 --- a/cmd/mist/assets/examples/coin.html +++ b/cmd/mist/assets/examples/coin.html @@ -80,11 +80,6 @@ refresh(); }); - var ev = contract.SingleTransact({}) - ev.watch(function(log) { - someElement.innerHTML += "tnaheousnthaoeu"; - }); - eth.watch('chain').changed(function() { refresh(); }); diff --git a/cmd/mist/assets/examples/info.html b/cmd/mist/assets/examples/info.html index d8816b19f..2a405c280 100644 --- a/cmd/mist/assets/examples/info.html +++ b/cmd/mist/assets/examples/info.html @@ -71,6 +71,10 @@ document.querySelector("#gas_price").innerHTML = eth.gasPrice; document.querySelector("#mining").innerHTML = eth.mining; document.querySelector("#listening").innerHTML = eth.listening; + eth.watch('chain').changed(function() { + document.querySelector("#number").innerHTML = eth.number; + }); + </script> </html> diff --git a/cmd/mist/assets/ext/ethereum.js/dist/ethereum.js b/cmd/mist/assets/ext/ethereum.js/dist/ethereum.js index d0e9d3cb7..83b598b3f 100644 --- a/cmd/mist/assets/ext/ethereum.js/dist/ethereum.js +++ b/cmd/mist/assets/ext/ethereum.js/dist/ethereum.js @@ -1417,6 +1417,8 @@ var ethMethods = function () { var methods = [ { name: 'balanceAt', call: 'eth_balanceAt' }, + { name: 'register', call: 'eth_register' }, + { name: 'unregister', call: 'eth_unregister' }, { name: 'stateAt', call: 'eth_stateAt' }, { name: 'storageAt', call: 'eth_storageAt' }, { name: 'countAt', call: 'eth_countAt'}, diff --git a/cmd/mist/assets/qml/main.qml b/cmd/mist/assets/qml/main.qml index 78a6dd846..65f38f8bd 100644 --- a/cmd/mist/assets/qml/main.qml +++ b/cmd/mist/assets/qml/main.qml @@ -46,7 +46,6 @@ ApplicationWindow { walletWeb.view.url = "http://ethereum-dapp-wallet.meteor.com/"; walletWeb.menuItem.title = "Wallet"; - addPlugin("./views/wallet.qml", {noAdd: true, close: false, section: "legacy"}); addPlugin("./views/miner.qml", {noAdd: true, close: false, section: "ethereum", active: false}); addPlugin("./views/transaction.qml", {noAdd: true, close: false, section: "legacy"}); addPlugin("./views/whisper.qml", {noAdd: true, close: false, section: "legacy"}); @@ -880,7 +879,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 9ce6ba650..c9419473c 100644 --- a/cmd/mist/gui.go +++ b/cmd/mist/gui.go @@ -394,8 +394,6 @@ func (gui *Gui) update() { miningLabel := gui.getObjectByName("miningLabel") events := gui.eth.EventMux().Subscribe( - //eth.PeerListEvent{}, - core.NewBlockEvent{}, core.TxPreEvent{}, core.TxPostEvent{}, ) @@ -408,41 +406,11 @@ func (gui *Gui) update() { return } switch ev := ev.(type) { - case core.NewBlockEvent: - gui.processBlock(ev.Block, false) - //gui.setWalletValue(gui.eth.ChainManager().State().GetBalance(gui.address()), nil) - balance := ethutil.CurrencyToString(gui.eth.ChainManager().State().GetBalance(gui.address())) - gui.getObjectByName("balanceLabel").Set("text", fmt.Sprintf("%v", balance)) - 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: diff --git a/cmd/mist/main.go b/cmd/mist/main.go index 32222fbef..14f561e99 100644 --- a/cmd/mist/main.go +++ b/cmd/mist/main.go @@ -60,6 +60,7 @@ func run() error { MaxPeers: MaxPeer, Port: OutboundPort, NAT: NAT, + Shh: true, BootNodes: BootNodes, NodeKey: NodeKey, KeyRing: KeyRing, |