Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@ class CTestNetParams : public CChainParams {
// Testnet Dash BIP44 coin type is '1' (All coin's testnet default)
nExtCoinType = 1;

// This is temporary until we reset testnet for retesting of the full DIP3 deployment
consensus.nTemporaryTestnetForkDIP3Height = 264000;
consensus.nTemporaryTestnetForkHeight = 273000;
consensus.nTemporaryTestnetForkDIP3BlockHash.SetHex("00000048e6e71d4bd90e7c456dcb94683ae832fcad13e1760d8283f7e89f332f");

fMiningRequiresPeers = true;
fDefaultConsistencyChecks = false;
fRequireStandard = false;
Expand Down
5 changes: 5 additions & 0 deletions src/consensus/params.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ struct Params {
int nMinimumDifficultyBlocks{0};
int nHighSubsidyBlocks{0};
int nHighSubsidyFactor{1};

// This is temporary until we reset testnet for retesting of the full DIP3 deployment
int nTemporaryTestnetForkDIP3Height{0};
uint256 nTemporaryTestnetForkDIP3BlockHash;
int nTemporaryTestnetForkHeight{0};
};
} // namespace Consensus

Expand Down
14 changes: 14 additions & 0 deletions src/evo/cbtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "simplifiedmns.h"
#include "specialtx.h"

#include "chainparams.h"
#include "univalue.h"
#include "validation.h"

Expand Down Expand Up @@ -71,6 +72,19 @@ bool CalcCbTxMerkleRootMNList(const CBlock& block, const CBlockIndex* pindexPrev
}

CSimplifiedMNList sml(tmpMNList);

// BEGIN TEMPORARY CODE
const auto& consensus = Params().GetConsensus();
if (consensus.nTemporaryTestnetForkHeight != 0 &&
pindexPrev->nHeight + 1 >= consensus.nTemporaryTestnetForkDIP3Height &&
pindexPrev->nHeight + 1 < consensus.nTemporaryTestnetForkHeight &&
chainActive[consensus.nTemporaryTestnetForkDIP3Height]->GetBlockHash() == consensus.nTemporaryTestnetForkDIP3BlockHash) {
for (auto& sme : sml.mnList) {
sme.confirmedHash.SetNull();
}
}
// END TEMPORARY CODE

bool mutated = false;
merkleRootRet = sml.CalcMerkleRoot(&mutated);
return !mutated;
Expand Down
1 change: 1 addition & 0 deletions src/evo/simplifiedmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

CSimplifiedMNListEntry::CSimplifiedMNListEntry(const CDeterministicMN& dmn) :
proRegTxHash(dmn.proTxHash),
confirmedHash(dmn.pdmnState->confirmedHash),
service(dmn.pdmnState->addr),
pubKeyOperator(dmn.pdmnState->pubKeyOperator),
keyIDVoting(dmn.pdmnState->keyIDVoting),
Expand Down