diff options
author | Maran <maran.hidskes@gmail.com> | 2014-05-27 17:49:42 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-05-27 17:49:42 +0800 |
commit | 1ab865a994758cef8a6bf75a3cc263f16a97d847 (patch) | |
tree | 59bbf8b696cf0e9a6d5cb7cbb0849a33d4dd896f /ethereal/assets/qml/wallet.qml | |
parent | 07204f129e277fb5f63f080d6a146e28603f872e (diff) | |
download | dexon-1ab865a994758cef8a6bf75a3cc263f16a97d847.tar.gz dexon-1ab865a994758cef8a6bf75a3cc263f16a97d847.tar.zst dexon-1ab865a994758cef8a6bf75a3cc263f16a97d847.zip |
Adding new blocks on broadcast
Diffstat (limited to 'ethereal/assets/qml/wallet.qml')
-rw-r--r-- | ethereal/assets/qml/wallet.qml | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ethereal/assets/qml/wallet.qml b/ethereal/assets/qml/wallet.qml index 911422f91..e59e85ab3 100644 --- a/ethereal/assets/qml/wallet.qml +++ b/ethereal/assets/qml/wallet.qml @@ -642,13 +642,22 @@ ApplicationWindow { txModel.insert(0, {inout: inout, hash: tx.hash, address: tx.address, value: tx.value, contract: isContract}) } - function addBlock(block) { + function addBlock(block, initial) { var txs = JSON.parse(block.transactions); var amount = 0 + if(initial == undefined){ + initial = false + } + if(txs != null){ amount = txs.length } - blockModel.insert(0, {number: block.number, hash: block.hash, txs: txs, txAmount: amount, time: block.time, prettyTime: convertToPretty(block.time)}) + + if(initial){ + blockModel.append({number: block.number, hash: block.hash, txs: txs, txAmount: amount, time: block.time, prettyTime: convertToPretty(block.time)}) + }else{ + blockModel.insert(0, {number: block.number, hash: block.hash, txs: txs, txAmount: amount, time: block.time, prettyTime: convertToPretty(block.time)}) + } } function addLog(str) { |