From 72268f14075780e460d30191ebb93235db136569 Mon Sep 17 00:00:00 2001 From: ElpidioMC Date: Wed, 4 Jul 2018 22:00:38 -0400 Subject: [PATCH] Fix Nodes and Alert. --- compilar.sh => Compilar.sh | 0 Compilar_Ubuntu18.sh | 11 ++++++++++ README.md | 11 ++++++++-- src/alert.cpp | 42 +++++++++++++++++++++++++++++--------- src/net.cpp | 5 +++-- src/rpcrawtransaction.cpp | 2 +- 6 files changed, 56 insertions(+), 15 deletions(-) rename compilar.sh => Compilar.sh (100%) create mode 100755 Compilar_Ubuntu18.sh mode change 100644 => 100755 src/rpcrawtransaction.cpp diff --git a/compilar.sh b/Compilar.sh similarity index 100% rename from compilar.sh rename to Compilar.sh diff --git a/Compilar_Ubuntu18.sh b/Compilar_Ubuntu18.sh new file mode 100755 index 0000000..d3a20d6 --- /dev/null +++ b/Compilar_Ubuntu18.sh @@ -0,0 +1,11 @@ +# scrypt para instalar la Wallet de BolivarCoin en GNU/Linux + +# Actualizar el sistema e instalar dependencias +sudo apt-get install libssl1.0-dev qt5-default qt5-qmake qtbase5-dev-tools qttools5-dev-tools build-essential libdb++-dev libboost-all-dev libqrencode-dev libminiupnpc-dev qrencode libqrencode-dev git automake autoconf pkg-config libcurl-openssl1.0-dev libjansson-dev libgmp-dev make g++ gcc-6 g++-6 +sudo add-apt-repository ppa:bitcoin/bitcoin +sudo apt-get update +sudo apt-get install libdb4.8-dev libdb4.8++-dev + +# Compilar la wallet +qmake "USE_QRCODE=1" +make diff --git a/README.md b/README.md index 2d90bd9..8ecfca8 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,16 @@ Escribir en la terminal los siguientes comandos: sudo apt-get update sudo apt-get upgrade sudo apt-get install git -git clone https://github.com/ElpidioMC/bolivarcoin -cd bolivarcoin +git clone https://github.com/ElpidioMC/Bolivarcoin +cd Bolivarcoin + +## Para Ubuntu 17.10 y anteriores. chmod +x compilar.sh ./Compilar.sh ./Bolivarcoin-qt + +## Para Ubuntu 18.04 y superiores. +chmod +x compilar.sh +./Compilar_Ubuntu18.sh +./Bolivarcoin-qt ``` diff --git a/src/alert.cpp b/src/alert.cpp index 415d176..58c8b9d 100644 --- a/src/alert.cpp +++ b/src/alert.cpp @@ -190,13 +190,41 @@ bool CAlert::ProcessAlert(bool fThread) nMaxVer == maxInt && setSubVer.empty() && nPriority == maxInt && - strStatusBar == "URGENT: Alert key compromised, upgrade required" + strStatusBar == "URGENT: Alert key compromised, upgrade required" && + strComment == "" && + strReserved == "" && + nVersion == 1 )) return false; } { LOCK(cs_mapAlerts); + + // Check if this alert has been cancelled + BOOST_FOREACH(PAIRTYPE(const uint256, CAlert)& item, mapAlerts) + { + const CAlert& alert = item.second; + if (alert.Cancels(*this)) + { + printf("alert", "alert already cancelled by %d\n", alert.nID); + return false; + } + if ( + alert.nExpiration == maxInt && + alert.nCancel == (maxInt-1) && + alert.nMinVer == 0 && + alert.nMaxVer == maxInt && + alert.setSubVer.empty() && + alert.nPriority == maxInt && + alert.strStatusBar == "URGENT: Alert key compromised, upgrade required" && + alert.strComment == "" && + alert.strReserved == "" && + alert.nVersion == 1 + ) { // If we have a final alert, do not continue + return false; + } + } // Cancel previous alerts for (map::iterator mi = mapAlerts.begin(); mi != mapAlerts.end();) { @@ -217,15 +245,9 @@ bool CAlert::ProcessAlert(bool fThread) mi++; } - // Check if this alert has been cancelled - BOOST_FOREACH(PAIRTYPE(const uint256, CAlert)& item, mapAlerts) - { - const CAlert& alert = item.second; - if (alert.Cancels(*this)) - { - printf("alert already cancelled by %d\n", alert.nID); - return false; - } + // Do not allow more than 5 concurrent alerts + if (mapAlerts.size() >= 5) { + return false; } // Add to mapAlerts diff --git a/src/net.cpp b/src/net.cpp index 493c906..3a0e288 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1192,8 +1192,9 @@ void MapPort(bool) // The first name is used as information source for addrman. // The second name should resolve to a list of seed addresses. static const char *strMainNetDNSSeed[][2] = { - {"sytes.net", "159.65.203.140"}, - {"128.199.229.71", "107.170.233.106"}, + {"159.65.203.140", "159.65.203.140"}, + {"128.199.229.71", "128.199.229.71"}, + {"107.170.233.106", "107.170.233.106"}, {NULL, NULL} }; diff --git a/src/rpcrawtransaction.cpp b/src/rpcrawtransaction.cpp old mode 100644 new mode 100755 index 4f850fb..8bb6791 --- a/src/rpcrawtransaction.cpp +++ b/src/rpcrawtransaction.cpp @@ -239,7 +239,7 @@ Value listunspent(const Array& params, bool fHelp) CTxDestination address; if (ExtractDestination(pk, address)) { - const CScriptID& hash = boost::get(address); + const CScriptID& hash = boost::get(address); CScript redeemScript; if (pwalletMain->GetCScript(hash, redeemScript)) entry.push_back(Pair("redeemScript", HexStr(redeemScript.begin(), redeemScript.end())));