From c3760df77d01bd344304a0d3572140426ed4fc60 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sat, 4 Apr 2015 20:30:22 +0200 Subject: [PATCH] Fix update problems in AZ. Fixes #1486 Connect requires peer by default. --- alethzero/Connect.cpp | 5 +++-- alethzero/Connect.ui | 3 +++ alethzero/MainWin.cpp | 2 +- libethereum/ClientBase.cpp | 8 +++++--- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/alethzero/Connect.cpp b/alethzero/Connect.cpp index 32fa74f38..69cc43f93 100644 --- a/alethzero/Connect.cpp +++ b/alethzero/Connect.cpp @@ -38,13 +38,14 @@ Connect::~Connect() void Connect::setEnvironment(QStringList const& _nodes) { - ui->host->addItems(_nodes); + if (ui->host->count() == 0) + ui->host->addItems(_nodes); } void Connect::reset() { ui->nodeId->clear(); - ui->required->setChecked(false); + ui->required->setChecked(true); } QString Connect::host() diff --git a/alethzero/Connect.ui b/alethzero/Connect.ui index 9a0522e5f..1ace94c8d 100644 --- a/alethzero/Connect.ui +++ b/alethzero/Connect.ui @@ -59,6 +59,9 @@ Required (Always Connect to this Peer) + + true + false diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index b17d47cdf..af6e1a731 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -285,7 +285,7 @@ void Main::onKeysChanged() unsigned Main::installWatch(LogFilter const& _tf, WatchHandler const& _f) { - auto ret = ethereum()->installWatch(_tf); + auto ret = ethereum()->installWatch(_tf, Reaping::Manual); m_handlers[ret] = _f; _f(LocalisedLogEntries()); return ret; diff --git a/libethereum/ClientBase.cpp b/libethereum/ClientBase.cpp index b45b9cf27..f949391fd 100644 --- a/libethereum/ClientBase.cpp +++ b/libethereum/ClientBase.cpp @@ -265,7 +265,8 @@ LocalisedLogEntries ClientBase::peekWatch(unsigned _watchId) const // cwatch << "peekWatch" << _watchId; auto& w = m_watches.at(_watchId); // cwatch << "lastPoll updated to " << chrono::duration_cast(chrono::system_clock::now().time_since_epoch()).count(); - w.lastPoll = chrono::system_clock::now(); + if (w.lastPoll != chrono::system_clock::time_point::max()) + w.lastPoll = chrono::system_clock::now(); return w.changes; } @@ -278,8 +279,9 @@ LocalisedLogEntries ClientBase::checkWatch(unsigned _watchId) auto& w = m_watches.at(_watchId); // cwatch << "lastPoll updated to " << chrono::duration_cast(chrono::system_clock::now().time_since_epoch()).count(); std::swap(ret, w.changes); - w.lastPoll = chrono::system_clock::now(); - + if (w.lastPoll != chrono::system_clock::time_point::max()) + w.lastPoll = chrono::system_clock::now(); + return ret; }