|
@ -260,14 +260,29 @@ ColumnLayout { |
|
|
sourceImg: "qrc:/qml/img/recycle-icon@2x.png" |
|
|
sourceImg: "qrc:/qml/img/recycle-icon@2x.png" |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Timer |
|
|
|
|
|
{ |
|
|
|
|
|
id: ensureNotFuturetime |
|
|
|
|
|
interval: 1000 |
|
|
|
|
|
repeat: false |
|
|
|
|
|
running: false |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
ScenarioButton { |
|
|
ScenarioButton { |
|
|
id: addBlockBtn |
|
|
id: addBlockBtn |
|
|
text: qsTr("Add Block") |
|
|
text: qsTr("Add Block") |
|
|
onClicked: |
|
|
onClicked: |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (ensureNotFuturetime.running) |
|
|
|
|
|
return |
|
|
|
|
|
if (clientModel.mining || clientModel.running) |
|
|
|
|
|
return |
|
|
var lastBlock = model.blocks[model.blocks.length - 1] |
|
|
var lastBlock = model.blocks[model.blocks.length - 1] |
|
|
if (lastBlock.status === "pending") |
|
|
if (lastBlock.status === "pending") |
|
|
|
|
|
{ |
|
|
|
|
|
ensureNotFuturetime.start() |
|
|
clientModel.mine() |
|
|
clientModel.mine() |
|
|
|
|
|
} |
|
|
else |
|
|
else |
|
|
addNewBlock() |
|
|
addNewBlock() |
|
|
} |
|
|
} |
|
|