diff --git a/alethzero/Main.ui b/alethzero/Main.ui index bcef815d5..a76d5b77c 100644 --- a/alethzero/Main.ui +++ b/alethzero/Main.ui @@ -149,6 +149,7 @@ Deb&ug + @@ -420,6 +421,7 @@ + @@ -1007,6 +1009,14 @@ F10 + + + true + + + Mining &Paranoia + + diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 386a373ac..ac6b3a098 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -168,7 +168,7 @@ Main::Main(QWidget *parent) : ui->setupUi(this); g_logPost = [=](std::string const& s, char const* c) { simpleDebugOut(s, c); ui->log->addItem(QString::fromStdString(s)); }; m_client.reset(new Client("AlethZero")); - m_client->setParanoia(true); + m_client->setParanoia(false); m_refresh = new QTimer(this); connect(m_refresh, SIGNAL(timeout()), SLOT(refresh())); @@ -314,6 +314,11 @@ void Main::on_about_triggered() QMessageBox::about(this, "About AlethZero PoC-" + QString(ETH_QUOTED(ETH_VERSION)).section('.', 1, 1), QString("AlethZero/v" ETH_QUOTED(ETH_VERSION) "/" ETH_QUOTED(ETH_BUILD_TYPE) "/" ETH_QUOTED(ETH_BUILD_PLATFORM) "\n" ETH_QUOTED(ETH_COMMIT_HASH)) + (ETH_CLEAN_REPO ? "\nCLEAN" : "\n+ LOCAL CHANGES") + "\n\nBy Gav Wood, 2014.\nBased on a design by Vitalik Buterin.\n\nTeam Ethereum++ includes: Eric Lombrozo, Marko Simovic, Alex Leverington, Tim Hughes and several others."); } +void Main::on_paranoia_triggered() +{ + m_client->setParanoia(ui->paranoia->isChecked()); +} + void Main::writeSettings() { QSettings s("ethereum", "alethzero"); @@ -328,6 +333,7 @@ void Main::writeSettings() s.setValue("address", b); s.setValue("upnp", ui->upnp->isChecked()); + s.setValue("paranoia", ui->paranoia->isChecked()); s.setValue("clientName", ui->clientName->text()); s.setValue("idealPeers", ui->idealPeers->value()); s.setValue("port", ui->port->value()); @@ -367,6 +373,7 @@ void Main::readSettings() m_client->setAddress(m_myKeys.back().address()); m_peers = s.value("peers").toByteArray(); ui->upnp->setChecked(s.value("upnp", true).toBool()); + ui->upnp->setChecked(s.value("paranoia", false).toBool()); ui->clientName->setText(s.value("clientName", "").toString()); ui->idealPeers->setValue(s.value("idealPeers", ui->idealPeers->value()).toInt()); ui->port->setValue(s.value("port", ui->port->value()).toInt()); diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index cc893dbea..5e1ba23eb 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -67,6 +67,7 @@ private slots: void on_contracts_currentItemChanged(); void on_transactionQueue_currentItemChanged(); void on_about_triggered(); + void on_paranoia_triggered(); void on_nameReg_textChanged(); void on_preview_triggered() { refresh(true); } void on_quit_triggered() { close(); } diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 0cb12901f..d56313fd3 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -233,6 +233,8 @@ void Client::work() m_doMine = false; } } + else + m_postMine.commitToMine(m_bc); } }