From 82100d1cc75df72aef3455ac5db3018838204599 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sun, 26 Oct 2014 18:39:34 +0100 Subject: [PATCH 1/2] Force name entry. --- alethzero/MainWin.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 870442a36..3ba203244 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -564,6 +564,8 @@ void Main::readSettings(bool _skipGeometry) m_enableOptimizer = s.value("enableOptimizer", true).toBool(); ui->enableOptimizer->setChecked(m_enableOptimizer); ui->clientName->setText(s.value("clientName", "").toString()); + if (ui->clientName->text().isEmpty()) + ui->clientName->setText(QInputDialog::getText(this, "Enter identity", "Enter a string that will identify you on the peer network")); ui->idealPeers->setValue(s.value("idealPeers", ui->idealPeers->value()).toInt()); ui->port->setValue(s.value("port", ui->port->value()).toInt()); ui->nameReg->setText(s.value("nameReg", "").toString()); From 2c29f1bc3ae841b5063909fd43cc4fe884ada3bc Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sun, 26 Oct 2014 20:47:26 +0100 Subject: [PATCH 2/2] Minor reload issue eased. --- alethzero/MainWin.cpp | 4 +++- libwhisper/Message.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 3ba203244..c42cddc4f 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -134,6 +134,8 @@ Main::Main(QWidget *parent) : connect(ui->webView, &QWebView::loadStarted, [this]() { + m_ethereum = nullptr; + m_whisper = nullptr; // NOTE: no need to delete as QETH_INSTALL_JS_NAMESPACE adopts it. m_dev = new QDev(this); m_ethereum = new QEthereum(this, ethereum(), owned()); @@ -565,7 +567,7 @@ void Main::readSettings(bool _skipGeometry) ui->enableOptimizer->setChecked(m_enableOptimizer); ui->clientName->setText(s.value("clientName", "").toString()); if (ui->clientName->text().isEmpty()) - ui->clientName->setText(QInputDialog::getText(this, "Enter identity", "Enter a string that will identify you on the peer network")); + ui->clientName->setText(QInputDialog::getText(this, "Enter identity", "Enter a name that will identify you on the peer network")); ui->idealPeers->setValue(s.value("idealPeers", ui->idealPeers->value()).toInt()); ui->port->setValue(s.value("port", ui->port->value()).toInt()); ui->nameReg->setText(s.value("nameReg", "").toString()); diff --git a/libwhisper/Message.cpp b/libwhisper/Message.cpp index cdfc050d8..93dcaa033 100644 --- a/libwhisper/Message.cpp +++ b/libwhisper/Message.cpp @@ -48,7 +48,7 @@ bool Message::populate(bytes const& _data) return false; byte flags = _data[0]; - if (!!(flags & ContainsSignature) && _data.size() > sizeof(Signature) + 1) // has a signature + if (!!(flags & ContainsSignature) && _data.size() >= sizeof(Signature) + 1) // has a signature { bytesConstRef payload = bytesConstRef(&_data).cropped(1, _data.size() - sizeof(Signature) - 1); h256 h = sha3(payload);