From 84676251157a9824fc0d424499d64e8bafe32bfb Mon Sep 17 00:00:00 2001 From: John Studnicka Date: Tue, 19 Jan 2021 16:06:13 -0700 Subject: [PATCH 1/7] Check for pubkey length --- src/validation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/validation.cpp b/src/validation.cpp index aeaaecf103..aa07c2fbf0 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -5751,7 +5751,7 @@ bool CheckBlockSignature(const CBlock& block) if ((pubkeyStart + CPubKey::COMPRESSED_SIZE) > txin.scriptSig.size() || txin.scriptSig[pubkeyStart-1] < CPubKey::COMPRESSED_SIZE) // last pushdata must be large enough to at least hold a compressed pubkey return error("%s : p2pkh txin.scriptSig.size() = %u is too small", __func__, txin.scriptSig.size()); pubkey = CPubKey(txin.scriptSig.begin()+pubkeyStart, txin.scriptSig.end()); - } else if (cbtxin.scriptSig.size() > CPubKey::COMPRESSED_SIZE) { // check for pubkey in coinbase + } else if (cbtxin.scriptSig.size() > CPubKey::COMPRESSED_SIZE && cbtxin.scriptSig[cbtxin.scriptSig.size()-CPubKey::COMPRESSED_SIZE-1] == CPubKey::COMPRESSED_SIZE) { // check for pubkey in coinbase //std::vector vchPubKey(cbtxin.scriptSig.end()-CPubKey::COMPRESSED_SIZE, cbtxin.scriptSig.end()); //LogPrintf("%s : coinbase cbtxin.scriptSig = %s\n", __func__, HexStr(cbtxin.scriptSig)); //LogPrintf("%s : cbtxin.scriptSig.size() = %u, vchPubKey = %s\n", __func__, cbtxin.scriptSig.size(), HexStr(vchPubKey)); From c35908f4d4338adf6cbac131f71c289dcccf8396 Mon Sep 17 00:00:00 2001 From: John Studnicka Date: Fri, 22 Jan 2021 20:22:07 -0700 Subject: [PATCH 2/7] Check if jsonAnswer is a json object --- src/qt/utilitydialog.cpp | 70 +++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 34 deletions(-) diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index 6506d4f02a..bc0e9a52ac 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -171,9 +171,9 @@ UpdateWalletDialog::~UpdateWalletDialog() void UpdateWalletDialog::checkForUpdate() { - const QString VERSION_URL = "https://raw.githubusercontent.com/ElectraProtocol/xep-ecosystem-versions/main/XEP-Core/latestversion.json"; + const QUrl strVerUrl = QUrl("https://raw.githubusercontent.com/ElectraProtocol/xep-ecosystem-versions/main/XEP-Core/latestversion.json"); - const QNetworkRequest request(VERSION_URL); + const QNetworkRequest request(strVerUrl); reply = manager->get(request); } @@ -183,40 +183,42 @@ void UpdateWalletDialog::gotReply() const QByteArray response_data = reply->readAll(); delete reply; const QJsonDocument jsonAnswer = QJsonDocument::fromJson(response_data); - const QJsonObject &responseObject = jsonAnswer.object(); - - const QString strVerMajor = "version_major"; - const QString strVerMinor = "version_minor"; - const QString strVerRev = "version_revision"; - const QString strVerBuild = "version_build"; - const QString strVerRC = "version_rc"; - const QString strMandatory = "mandatory"; - const QString strLastMandatory = "lastmandatory"; - - if (responseObject.size() == 7 && responseObject[strVerMajor].isDouble() && responseObject[strVerMinor].isDouble() && - responseObject[strVerRev].isDouble() && responseObject[strVerBuild].isDouble() && responseObject[strVerRC].isDouble() && - responseObject[strMandatory].isBool() && responseObject[strLastMandatory].isObject()) { - const QJsonObject &lastMandatory = responseObject[strLastMandatory].toObject(); - if (lastMandatory.size() == 5 && lastMandatory[strVerMajor].isDouble() && lastMandatory[strVerMinor].isDouble() && - lastMandatory[strVerRev].isDouble() && lastMandatory[strVerBuild].isDouble() && lastMandatory[strVerRC].isDouble()) { - bool outdated = true; - mandatoryUpdate = true; - - newVersionMajor = responseObject[strVerMajor].toInt(); - newVersionMinor = responseObject[strVerMinor].toInt(); - newVersionRevision = responseObject[strVerRev].toInt(); - newVersionBuild = responseObject[strVerBuild].toInt(); - newVersionRC = responseObject[strVerRC].toInt(); - if (lastMandatory[strVerMajor].toInt() <= CLIENT_VERSION_MAJOR && lastMandatory[strVerMinor].toInt() <= CLIENT_VERSION_MINOR && lastMandatory[strVerRev].toInt() <= CLIENT_VERSION_REVISION && lastMandatory[strVerBuild].toInt() <= CLIENT_VERSION_BUILD) { - mandatoryUpdate = responseObject[strMandatory].toBool(); - if (newVersionMajor <= CLIENT_VERSION_MAJOR && newVersionMinor <= CLIENT_VERSION_MINOR && newVersionRevision <= CLIENT_VERSION_REVISION && newVersionBuild <= CLIENT_VERSION_BUILD) { - outdated = false; + if (jsonAnswer.isObject()) { + const QJsonObject &responseObject = jsonAnswer.object(); + + const QString strVerMajor = "version_major"; + const QString strVerMinor = "version_minor"; + const QString strVerRev = "version_revision"; + const QString strVerBuild = "version_build"; + const QString strVerRC = "version_rc"; + const QString strMandatory = "mandatory"; + const QString strLastMandatory = "lastmandatory"; + + if (responseObject.size() == 7 && responseObject[strVerMajor].isDouble() && responseObject[strVerMinor].isDouble() && + responseObject[strVerRev].isDouble() && responseObject[strVerBuild].isDouble() && responseObject[strVerRC].isDouble() && + responseObject[strMandatory].isBool() && responseObject[strLastMandatory].isObject()) { + const QJsonObject &lastMandatory = responseObject[strLastMandatory].toObject(); + if (lastMandatory.size() == 5 && lastMandatory[strVerMajor].isDouble() && lastMandatory[strVerMinor].isDouble() && + lastMandatory[strVerRev].isDouble() && lastMandatory[strVerBuild].isDouble() && lastMandatory[strVerRC].isDouble()) { + bool outdated = true; + mandatoryUpdate = true; + + newVersionMajor = responseObject[strVerMajor].toInt(); + newVersionMinor = responseObject[strVerMinor].toInt(); + newVersionRevision = responseObject[strVerRev].toInt(); + newVersionBuild = responseObject[strVerBuild].toInt(); + newVersionRC = responseObject[strVerRC].toInt(); + if (lastMandatory[strVerMajor].toInt() <= CLIENT_VERSION_MAJOR && lastMandatory[strVerMinor].toInt() <= CLIENT_VERSION_MINOR && lastMandatory[strVerRev].toInt() <= CLIENT_VERSION_REVISION && lastMandatory[strVerBuild].toInt() <= CLIENT_VERSION_BUILD) { + mandatoryUpdate = responseObject[strMandatory].toBool(); + if (newVersionMajor <= CLIENT_VERSION_MAJOR && newVersionMinor <= CLIENT_VERSION_MINOR && newVersionRevision <= CLIENT_VERSION_REVISION && newVersionBuild <= CLIENT_VERSION_BUILD) { + outdated = false; + } } - } - if (outdated) { - ui->aboutMessage->setText(getUpdateString()); - exec(); + if (outdated) { + ui->aboutMessage->setText(getUpdateString()); + exec(); + } } } } From 5b49f65990af5275fbba27b37f2824c38286aae5 Mon Sep 17 00:00:00 2001 From: Jenova7 <38404798+Jenova7@users.noreply.github.com> Date: Wed, 27 Jan 2021 11:27:44 +0100 Subject: [PATCH 3/7] Update URL --- src/qt/utilitydialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp index bc0e9a52ac..7f0f4072b9 100644 --- a/src/qt/utilitydialog.cpp +++ b/src/qt/utilitydialog.cpp @@ -171,7 +171,7 @@ UpdateWalletDialog::~UpdateWalletDialog() void UpdateWalletDialog::checkForUpdate() { - const QUrl strVerUrl = QUrl("https://raw.githubusercontent.com/ElectraProtocol/xep-ecosystem-versions/main/XEP-Core/latestversion.json"); + const QUrl strVerUrl = QUrl("http://electraprotocol.eu/getlatestversion"); const QNetworkRequest request(strVerUrl); reply = manager->get(request); From a45249c62480aad1a1a99b33d3ec86f950328dac Mon Sep 17 00:00:00 2001 From: Jenova7 <38404798+Jenova7@users.noreply.github.com> Date: Wed, 27 Jan 2021 19:21:46 +0100 Subject: [PATCH 4/7] build QNetwork dependencies --- depends/packages/qt.mk | 4 ---- 1 file changed, 4 deletions(-) diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 365bec0538..daa3e30f18 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -86,12 +86,9 @@ $(package)_config_opts += -no-feature-concurrent $(package)_config_opts += -no-feature-dial $(package)_config_opts += -no-feature-fontcombobox $(package)_config_opts += -no-feature-ftp -$(package)_config_opts += -no-feature-http $(package)_config_opts += -no-feature-image_heuristic_mask $(package)_config_opts += -no-feature-keysequenceedit $(package)_config_opts += -no-feature-lcdnumber -$(package)_config_opts += -no-feature-networkdiskcache -$(package)_config_opts += -no-feature-networkproxy $(package)_config_opts += -no-feature-pdf $(package)_config_opts += -no-feature-printdialog $(package)_config_opts += -no-feature-printer @@ -99,7 +96,6 @@ $(package)_config_opts += -no-feature-printpreviewdialog $(package)_config_opts += -no-feature-printpreviewwidget $(package)_config_opts += -no-feature-regularexpression $(package)_config_opts += -no-feature-sessionmanager -$(package)_config_opts += -no-feature-socks5 $(package)_config_opts += -no-feature-sql $(package)_config_opts += -no-feature-statemachine $(package)_config_opts += -no-feature-syntaxhighlighter From aa0e6e2919b6da976bd86b61fafee25298db890b Mon Sep 17 00:00:00 2001 From: Jenova7 <38404798+Jenova7@users.noreply.github.com> Date: Thu, 28 Jan 2021 09:09:08 +0100 Subject: [PATCH 5/7] Update seeds --- src/chainparams.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 188899475d..3144fd7622 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -161,14 +161,14 @@ class CMainParams : public CChainParams { // This is fine at runtime as we'll fall back to using them as an addrfetch if they don't support the // service bits we want, but we should get them updated to support all service bits wanted by any // release ASAP to avoid it where possible. - vSeeds.emplace_back("seed01.electraprotocol.network"); - vSeeds.emplace_back("seed02.electraprotocol.network"); - vSeeds.emplace_back("seed03.electraprotocol.network"); - vSeeds.emplace_back("seed04.electraprotocol.network"); - vSeeds.emplace_back("seed05.electraprotocol.network"); - vSeeds.emplace_back("seed06.electraprotocol.network"); - vSeeds.emplace_back("seed07.electraprotocol.network"); - vSeeds.emplace_back("seed08.electraprotocol.network"); + vSeeds.emplace_back("seed01.electraprotocol.eu"); + vSeeds.emplace_back("seed02.electraprotocol.eu"); + vSeeds.emplace_back("seed03.electraprotocol.eu"); + vSeeds.emplace_back("seed04.electraprotocol.eu"); + vSeeds.emplace_back("seed05.electraprotocol.eu"); + vSeeds.emplace_back("seed06.electraprotocol.eu"); + vSeeds.emplace_back("seed07.electraprotocol.eu"); + vSeeds.emplace_back("seed08.electraprotocol.eu"); base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,55); base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,137); From f0c69f344617ea735fd359fd6004f9bf70c7d71c Mon Sep 17 00:00:00 2001 From: John Studnicka Date: Thu, 28 Jan 2021 05:35:46 -0700 Subject: [PATCH 6/7] Update testnet seeds --- src/chainparams.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 3144fd7622..f11a51d6eb 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -275,14 +275,14 @@ class CTestNetParams : public CChainParams { vFixedSeeds.clear(); vSeeds.clear(); // nodes with support for servicebits filtering should be at the top - vSeeds.emplace_back("seed01.electraprotocol.network"); - vSeeds.emplace_back("seed02.electraprotocol.network"); - vSeeds.emplace_back("seed03.electraprotocol.network"); - vSeeds.emplace_back("seed04.electraprotocol.network"); - vSeeds.emplace_back("seed05.electraprotocol.network"); - vSeeds.emplace_back("seed06.electraprotocol.network"); - vSeeds.emplace_back("seed07.electraprotocol.network"); - vSeeds.emplace_back("seed08.electraprotocol.network"); + vSeeds.emplace_back("seed01.electraprotocol.eu"); + vSeeds.emplace_back("seed02.electraprotocol.eu"); + vSeeds.emplace_back("seed03.electraprotocol.eu"); + vSeeds.emplace_back("seed04.electraprotocol.eu"); + vSeeds.emplace_back("seed05.electraprotocol.eu"); + vSeeds.emplace_back("seed06.electraprotocol.eu"); + vSeeds.emplace_back("seed07.electraprotocol.eu"); + vSeeds.emplace_back("seed08.electraprotocol.eu"); base58Prefixes[PUBKEY_ADDRESS] = std::vector(1,141); base58Prefixes[SCRIPT_ADDRESS] = std::vector(1,19); @@ -325,14 +325,14 @@ class SigNetParams : public CChainParams { if (!args.IsArgSet("-signetchallenge")) { bin = ParseHex("512103ad5e0edad18cb1f0fc0d28a3d4f1f3e445640337489abb10404f2d1e086be430210359ef5021964fe22d6f8e05b2463c9540ce96883fe3b278760f048f5189f2e6c452ae"); - vSeeds.emplace_back("seed01.electraprotocol.network"); - vSeeds.emplace_back("seed02.electraprotocol.network"); - vSeeds.emplace_back("seed03.electraprotocol.network"); - vSeeds.emplace_back("seed04.electraprotocol.network"); - vSeeds.emplace_back("seed05.electraprotocol.network"); - vSeeds.emplace_back("seed06.electraprotocol.network"); - vSeeds.emplace_back("seed07.electraprotocol.network"); - vSeeds.emplace_back("seed08.electraprotocol.network"); + vSeeds.emplace_back("seed01.electraprotocol.eu"); + vSeeds.emplace_back("seed02.electraprotocol.eu"); + vSeeds.emplace_back("seed03.electraprotocol.eu"); + vSeeds.emplace_back("seed04.electraprotocol.eu"); + vSeeds.emplace_back("seed05.electraprotocol.eu"); + vSeeds.emplace_back("seed06.electraprotocol.eu"); + vSeeds.emplace_back("seed07.electraprotocol.eu"); + vSeeds.emplace_back("seed08.electraprotocol.eu"); //vSeeds.emplace_back("v7ajjeirttkbnt32wpy3c6w3emwnfr3fkla7hpxcfokr3ysd3kqtzmqd.onion:38333"); consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000000000000"); From 6635131f1765a89a77d0d927a4eeb2a39edd84c5 Mon Sep 17 00:00:00 2001 From: Jenova7 <38404798+Jenova7@users.noreply.github.com> Date: Mon, 1 Feb 2021 09:02:31 +0100 Subject: [PATCH 7/7] Release 1.0.1.1 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 859977d9aa..b04d0380dd 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_PREREQ([2.69]) define(_CLIENT_VERSION_MAJOR, 1) define(_CLIENT_VERSION_MINOR, 0) define(_CLIENT_VERSION_REVISION, 1) -define(_CLIENT_VERSION_BUILD, 0) +define(_CLIENT_VERSION_BUILD, 1) define(_CLIENT_VERSION_RC, 0) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2021)