Browse Source

Fix update problems in AZ.

Fixes #1486
Connect requires peer by default.
cl-refactor
Gav Wood 10 years ago
parent
commit
c3760df77d
  1. 5
      alethzero/Connect.cpp
  2. 3
      alethzero/Connect.ui
  3. 2
      alethzero/MainWin.cpp
  4. 8
      libethereum/ClientBase.cpp

5
alethzero/Connect.cpp

@ -38,13 +38,14 @@ Connect::~Connect()
void Connect::setEnvironment(QStringList const& _nodes) void Connect::setEnvironment(QStringList const& _nodes)
{ {
ui->host->addItems(_nodes); if (ui->host->count() == 0)
ui->host->addItems(_nodes);
} }
void Connect::reset() void Connect::reset()
{ {
ui->nodeId->clear(); ui->nodeId->clear();
ui->required->setChecked(false); ui->required->setChecked(true);
} }
QString Connect::host() QString Connect::host()

3
alethzero/Connect.ui

@ -59,6 +59,9 @@
<property name="text"> <property name="text">
<string>Required (Always Connect to this Peer)</string> <string>Required (Always Connect to this Peer)</string>
</property> </property>
<property name="checked">
<bool>true</bool>
</property>
<property name="tristate"> <property name="tristate">
<bool>false</bool> <bool>false</bool>
</property> </property>

2
alethzero/MainWin.cpp

@ -285,7 +285,7 @@ void Main::onKeysChanged()
unsigned Main::installWatch(LogFilter const& _tf, WatchHandler const& _f) 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; m_handlers[ret] = _f;
_f(LocalisedLogEntries()); _f(LocalisedLogEntries());
return ret; return ret;

8
libethereum/ClientBase.cpp

@ -265,7 +265,8 @@ LocalisedLogEntries ClientBase::peekWatch(unsigned _watchId) const
// cwatch << "peekWatch" << _watchId; // cwatch << "peekWatch" << _watchId;
auto& w = m_watches.at(_watchId); auto& w = m_watches.at(_watchId);
// cwatch << "lastPoll updated to " << chrono::duration_cast<chrono::seconds>(chrono::system_clock::now().time_since_epoch()).count(); // cwatch << "lastPoll updated to " << chrono::duration_cast<chrono::seconds>(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; return w.changes;
} }
@ -278,8 +279,9 @@ LocalisedLogEntries ClientBase::checkWatch(unsigned _watchId)
auto& w = m_watches.at(_watchId); auto& w = m_watches.at(_watchId);
// cwatch << "lastPoll updated to " << chrono::duration_cast<chrono::seconds>(chrono::system_clock::now().time_since_epoch()).count(); // cwatch << "lastPoll updated to " << chrono::duration_cast<chrono::seconds>(chrono::system_clock::now().time_since_epoch()).count();
std::swap(ret, w.changes); 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; return ret;
} }

Loading…
Cancel
Save