From 9062fc8587fed10aa627c922db314d2db5640739 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Wed, 20 Mar 2019 10:40:27 -0700 Subject: [PATCH] Show Sprout security warning --- src/mainwindow.ui | 23 +++++++++++++++++++++-- src/rpc.cpp | 3 ++- src/settings.cpp | 8 ++++++++ src/settings.h | 4 ++++ 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 9ee17a2..30ec70e 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -22,7 +22,7 @@ - 1 + 2 @@ -730,6 +730,25 @@ + + + + color: red; + + + <html><head/><body><p>You should suspend trust in the receipt of funds to Sprout z-addresses until you upgrade to zcash v2.0.4. See <a href="https://z.cash/support/security/announcements/security-announcement-2019-03-19/"><span style=" text-decoration: underline; color:#0000ff;">Security Announcement</span></a>.</p></body></html> + + + Qt::RichText + + + true + + + Qt::TextBrowserInteraction + + + @@ -1029,7 +1048,7 @@ 0 0 968 - 19 + 22 diff --git a/src/rpc.cpp b/src/rpc.cpp index a1636a3..50a0de6 100644 --- a/src/rpc.cpp +++ b/src/rpc.cpp @@ -551,6 +551,7 @@ void RPC::getInfoThenRefresh(bool force) { static int lastBlock = 0; int curBlock = reply["blocks"].get(); int version = reply["version"].get(); + Settings::getInstance()->setZcashdVersion(version); if ( force || (curBlock != lastBlock) ) { // Something changed, so refresh everything. @@ -646,7 +647,7 @@ void RPC::getInfoThenRefresh(bool force) { else { tooltip = QObject::tr("zcashd has no peer connections"); } - tooltip = tooltip % "(v " % QString::number(version) % ")"; + tooltip = tooltip % "(v " % QString::number(Settings::getInstance()->getZcashdVersion()) % ")"; if (!zecPrice.isEmpty()) { tooltip = "1 ZEC = " % zecPrice % "\n" % tooltip; diff --git a/src/settings.cpp b/src/settings.cpp index b8ae3a3..6810d51 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -82,6 +82,14 @@ bool Settings::isTAddress(QString addr) { return addr.startsWith("t"); } +int Settings::getZcashdVersion() { + return _zcashdVersion; +} + +void Settings::setZcashdVersion(int version) { + _zcashdVersion = version; +} + bool Settings::isSyncing() { return _isSyncing; } diff --git a/src/settings.h b/src/settings.h index 680f363..03ba530 100644 --- a/src/settings.h +++ b/src/settings.h @@ -31,6 +31,9 @@ public: bool isSyncing(); void setSyncing(bool syncing); + int getZcashdVersion(); + void setZcashdVersion(int version); + void setUseEmbedded(bool r) { _useEmbedded = r; } bool useEmbedded() { return _useEmbedded; } @@ -105,6 +108,7 @@ private: bool _isTestnet = false; bool _isSyncing = false; int _blockNumber = 0; + int _zcashdVersion = 0; bool _useEmbedded = false; bool _headless = false; int _peerConnections = 0;