Skip to content

Commit

Permalink
Ban 0.13.8.1 from the network (#520)
Browse files Browse the repository at this point in the history
* Ban 0.13.8.1 from the network
  • Loading branch information
psolstice authored and a-bezrukov committed Jul 17, 2019
1 parent 67785c5 commit 5e0b843
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
3 changes: 3 additions & 0 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
7 changes: 7 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/zerocoin_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ static const int64_t DUST_HARD_LIMIT = 1000; // 0.00001 XZC mininput
#define ZC_SIGMA_STARTING_BLOCK 184200 //Approx July 30th, 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
Expand Down

0 comments on commit 5e0b843

Please sign in to comment.