diff --git a/README.md b/README.md index d89d8d021f..05a86ea756 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Zcoin v0.13.8.1 +Zcoin v0.13.8.2 =============== [![Build Status](https://travis-ci.com/zcoinofficial/zcoin.svg?branch=CI)](https://travis-ci.com/zcoinofficial/zcoin) diff --git a/configure.ac b/configure.ac index 63f6404352..c6d5733f1b 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) define(_CLIENT_VERSION_MAJOR, 0) define(_CLIENT_VERSION_MINOR, 13) define(_CLIENT_VERSION_REVISION, 8) -define(_CLIENT_VERSION_BUILD, 1) +define(_CLIENT_VERSION_BUILD, 2) define(_CLIENT_VERSION_IS_RELEASE, true) define(_COPYRIGHT_YEAR, 2019) define(_COPYRIGHT_HOLDERS,[The %s developers]) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 248cdeaf9c..6cb1523152 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -253,6 +253,7 @@ class CMainParams : public CChainParams { // Sigma related values. consensus.nSigmaStartBlock = ZC_SIGMA_STARTING_BLOCK; + consensus.nOldSigmaBanBlock = ZC_OLD_SIGMA_BAN_BLOCK; consensus.nZerocoinV2MintMempoolGracefulPeriod = ZC_V2_MINT_GRACEFUL_MEMPOOL_PERIOD; consensus.nZerocoinV2MintGracefulPeriod = ZC_V2_MINT_GRACEFUL_PERIOD; consensus.nZerocoinV2SpendMempoolGracefulPeriod = ZC_V2_SPEND_GRACEFUL_MEMPOOL_PERIOD; @@ -440,6 +441,7 @@ class CTestNetParams : public CChainParams { // Sigma related values. consensus.nSigmaStartBlock = ZC_SIGMA_TESTNET_STARTING_BLOCK; + consensus.nOldSigmaBanBlock = 70416; consensus.nZerocoinV2MintMempoolGracefulPeriod = ZC_V2_MINT_TESTNET_GRACEFUL_MEMPOOL_PERIOD; consensus.nZerocoinV2MintGracefulPeriod = ZC_V2_MINT_TESTNET_GRACEFUL_PERIOD; consensus.nZerocoinV2SpendMempoolGracefulPeriod = ZC_V2_SPEND_TESTNET_GRACEFUL_MEMPOOL_PERIOD; @@ -593,6 +595,7 @@ class CRegTestParams : public CChainParams { // Sigma related values. consensus.nSigmaStartBlock = 400; + consensus.nOldSigmaBanBlock = 450; consensus.nZerocoinV2MintMempoolGracefulPeriod = 2; consensus.nZerocoinV2MintGracefulPeriod = 5; consensus.nZerocoinV2SpendMempoolGracefulPeriod = 10; diff --git a/src/consensus/params.h b/src/consensus/params.h index 61a35db9e3..5e6adf803d 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -128,6 +128,9 @@ struct Params { // The block number after which sigma are accepted. int nSigmaStartBlock; + // The block number after which old sigma clients are banned. + int nOldSigmaBanBlock; + // Number of blocks after nSigmaMintStartBlock during which we still accept zerocoin V2 mints into mempool. int nZerocoinV2MintMempoolGracefulPeriod; diff --git a/src/main.cpp b/src/main.cpp index 76eccc137c..eef6139150 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -6350,6 +6350,13 @@ bool static ProcessMessage(CNode *pfrom, string strCommand, if (!vRecv.empty()) { vRecv >> LIMITED_STRING(pfrom->strSubVer, MAX_SUBVERSION_LENGTH); pfrom->cleanSubVer = SanitizeString(pfrom->strSubVer); + if (nHeight > chainparams.GetConsensus().nOldSigmaBanBlock && pfrom->cleanSubVer == "/Satoshi:0.13.8.1/") { + pfrom->PushMessage(NetMsgType::REJECT, strCommand, REJECT_OBSOLETE, "This version is banned from the network"); + pfrom->fDisconnect = 1; + LOCK(cs_main); + Misbehaving(pfrom->GetId(), 100); + return false; + } } if (!vRecv.empty()) { vRecv >> pfrom->nStartingHeight; diff --git a/src/zerocoin_params.h b/src/zerocoin_params.h index 58aa553542..5b69620697 100644 --- a/src/zerocoin_params.h +++ b/src/zerocoin_params.h @@ -42,6 +42,9 @@ static const int64_t DUST_HARD_LIMIT = 1000; // 0.00001 XZC mininput #define ZC_SIGMA_STARTING_BLOCK 182030 //Approx July 23rd, 2019, 8:00 AM UTC #define ZC_SIGMA_TESTNET_STARTING_BLOCK 50000 +// The block number after which old sigma clients are banned. +#define ZC_OLD_SIGMA_BAN_BLOCK 181850 //Approx July 22nd, 2019, 4:00 AM UTC + // Number of blocks after ZC_SIGMA_STARTING_BLOCK during which we still accept zerocoin V2 mints into mempool. #define ZC_V2_MINT_GRACEFUL_MEMPOOL_PERIOD 4500 #define ZC_V2_MINT_TESTNET_GRACEFUL_MEMPOOL_PERIOD 500