diff --git a/src/settings.cpp b/src/settings.cpp index 0cedc43..eb57ff3 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -40,9 +40,20 @@ Explorer Settings::getExplorer() { auto txExplorerUrl = s.value("explorer/txExplorerUrl", explorer + "/tx/").toString(); auto addressExplorerUrl = s.value("explorer/addressExplorerUrl", explorer + "/address/").toString(); + auto testnetTxExplorerUrl = s.value("explorer/testnetTxExplorerUrl").toString(); auto testnetAddressExplorerUrl = s.value("explorer/testnetAddressExplorerUrl").toString(); + // Some users have the old malicious explorer URL saved in their config file, help them out + if (txExplorerUrl == "https://explorer.myhush.org/tx/") { + txExplorerUrl = explorer + "/tx/"; + saveExplorer(txExplorerUrl, addressExplorerUrl, testnetTxExplorerUrl, testnetAddressExplorerUrl); + } + if (addressExplorerUrl == "https://explorer.myhush.org/address/") { + addressExplorerUrl = explorer + "/address/"; + saveExplorer(txExplorerUrl, addressExplorerUrl, testnetTxExplorerUrl, testnetAddressExplorerUrl); + } + return Explorer{txExplorerUrl, addressExplorerUrl, testnetTxExplorerUrl, testnetAddressExplorerUrl}; } diff --git a/src/settings.h b/src/settings.h index 6b930ed..d788c7d 100644 --- a/src/settings.h +++ b/src/settings.h @@ -132,6 +132,7 @@ public: static double getZboardAmount(); static QString getZboardAddr(); + //TODO: this could be an advanced setting too static int getMaxMobileAppTxns() { return 30; } static bool isValidAddress(QString addr); @@ -162,12 +163,11 @@ private: bool _isTestnet = false; bool _isSyncing = false; int _blockNumber = 0; - int _hushdVersion = 0; + int _hushdVersion = 0; bool _useEmbedded = false; bool _headless = false; int _peerConnections = 0; - - double hushPrice = 0.0; + double hushPrice = 0.0; double fiat_price = 0.0; unsigned int btcPrice = 0; std::map prices;