From 6069456191fc2454cedadb2d49abebf5b52bf4fd Mon Sep 17 00:00:00 2001 From: coolblock Date: Wed, 30 Jan 2019 08:32:54 -0700 Subject: [PATCH 1/2] checkpoint and prevention of bad connections --- configure.ac | 2 +- src/chainparams.cpp | 5 +++-- src/main.cpp | 2 +- src/net.cpp | 3 ++- src/version.h | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 053b3fb..ad06d04 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) define(_CLIENT_VERSION_MINOR, 12) define(_CLIENT_VERSION_REVISION, 1) -define(_CLIENT_VERSION_BUILD, 12) +define(_CLIENT_VERSION_BUILD, 14) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2018) AC_INIT([Vivo Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/vivocoin/vivo/issues],[vivocore]) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 8cbcec7..42cb6fe 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -179,8 +179,9 @@ class CMainParams : public CChainParams { (307000, uint256S("0x000000000525621400e9d10a79b02237194e34667b73898cd5f9fc99ea58ec7a")) (337418, uint256S("0x000000001d8e498bbd22dca1ac0d6e5e234e2cc4e090130299a9a640f6d0a105")) (307500, uint256S("0x0000000021ba9398d0458721e41a362396c31abcb751cf4520ce973b5f2d96d6")) - (308000, uint256S("0x0000000018ee47a3c93296309ce207724868232706f59a6937362581476ce462")), - 1543442279, // * UNIX timestamp of last checkpoint block + (308000, uint256S("0x0000000018ee47a3c93296309ce207724868232706f59a6937362581476ce462")) + (349891, uint256S("0x000000000965eb7af631e8717d10b477568a699cbb5cc172f723204f699e3488")), + 1548858840, // * UNIX timestamp of last checkpoint block 5000, // * total number of transactions between genesis and last checkpoint // (the tx=... number in the SetBestChain debug.log lines) 500 // * estimated number of transactions per day after checkpoint diff --git a/src/main.cpp b/src/main.cpp index 71d0df3..17c17ee 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5268,7 +5268,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, uint64_t nNonce = 1; vRecv >> pfrom->nVersion >> pfrom->nServices >> nTime >> addrMe; - if (pfrom->nVersion < MIN_PEER_PROTO_VERSION | (pfrom->nVersion == 70209) | (pfrom->nVersion == 70208) ) + if (pfrom->nVersion < 70210) { // disconnect from peers older than this proto version LogPrintf("peer=%d using obsolete version %i; disconnecting\n", pfrom->id, pfrom->nVersion); diff --git a/src/net.cpp b/src/net.cpp index 430b6db..39b41ec 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2136,7 +2136,8 @@ void RelayTransaction(const CTransaction& tx, const CDataStream& ss) void RelayInv(CInv &inv, const int minProtoVersion) { LOCK(cs_vNodes); BOOST_FOREACH(CNode* pnode, vNodes) - if(pnode->nVersion >= minProtoVersion) + + if(pnode->nVersion >= 70210) pnode->PushInventory(inv); } diff --git a/src/version.h b/src/version.h index e7a65b7..48f9a7c 100644 --- a/src/version.h +++ b/src/version.h @@ -27,7 +27,7 @@ static const int CADDR_TIME_VERSION = 31402; //! only request blocks from nodes outside this range of versions static const int NOBLKS_VERSION_START = 32000; -static const int NOBLKS_VERSION_END = 32400; +static const int NOBLKS_VERSION_END = 70209; //! BIP 0031, pong message, is enabled for all versions AFTER this one static const int BIP0031_VERSION = 60000; From 7873efd38bcb5cecfa3b9a3f5313e39a7ee661af Mon Sep 17 00:00:00 2001 From: coolblock Date: Wed, 30 Jan 2019 10:09:34 -0700 Subject: [PATCH 2/2] Increased goverance minimum --- src/governance-object.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/governance-object.h b/src/governance-object.h index b755e37..c0bec72 100644 --- a/src/governance-object.h +++ b/src/governance-object.h @@ -24,8 +24,8 @@ class CGovernanceObject; class CGovernanceVote; static const int MAX_GOVERNANCE_OBJECT_DATA_SIZE = 16 * 1024; -static const int MIN_GOVERNANCE_PEER_PROTO_VERSION = 70206; -static const int GOVERNANCE_FILTER_PROTO_VERSION = 70206; +static const int MIN_GOVERNANCE_PEER_PROTO_VERSION = 70210; +static const int GOVERNANCE_FILTER_PROTO_VERSION = 70210; static const double GOVERNANCE_FILTER_FP_RATE = 0.001;