Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ban 0.13.8.1 from the network #520

Merged
merged 4 commits into from
Jul 17, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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 21st, 2019, 4:00 AM UTC
a-bezrukov marked this conversation as resolved.
Show resolved Hide resolved

// 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