From e2f83a88407b86b6224d71cb3bb1dba868fed296 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Jun 2015 16:39:48 +0200 Subject: [PATCH] add Timer to avoid FutureTime --- mix/qml/Block.qml | 8 -------- mix/qml/BlockChain.qml | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/mix/qml/Block.qml b/mix/qml/Block.qml index b3865ac4a..0fa69f1bd 100644 --- a/mix/qml/Block.qml +++ b/mix/qml/Block.qml @@ -232,15 +232,7 @@ ColumnLayout anchors.leftMargin: 10 text: { if (index >= 0 && transactions.get(index).logs && transactions.get(index).logs.count) - { - for (var k = 0; k < transactions.get(index).logs.count; k++) - { - console.log("_________________________") - console.log(JSON.stringify(transactions.get(index).logs[k])) - console.log("_________________________") - } return transactions.get(index).logs.count - } else return "" } diff --git a/mix/qml/BlockChain.qml b/mix/qml/BlockChain.qml index e9b1fc1db..202d6d75e 100644 --- a/mix/qml/BlockChain.qml +++ b/mix/qml/BlockChain.qml @@ -260,14 +260,29 @@ ColumnLayout { sourceImg: "qrc:/qml/img/recycle-icon@2x.png" } + Timer + { + id: ensureNotFuturetime + interval: 1000 + repeat: false + running: false + } + ScenarioButton { id: addBlockBtn text: qsTr("Add Block") onClicked: { + if (ensureNotFuturetime.running) + return + if (clientModel.mining || clientModel.running) + return var lastBlock = model.blocks[model.blocks.length - 1] if (lastBlock.status === "pending") + { + ensureNotFuturetime.start() clientModel.mine() + } else addNewBlock() }