Properly initialize confirmedHash in CSimplifiedMNListEntry (#2479)
* Properly initialize confirmedHash in CSimplifiedMNListEntry * Add consensus params for temporary hard-fork on testnet This hard-fork is required on testnet as we have to fix a few consensus bugs in DIP3/DIP4. It will also be required to introduce LLMQ commitments to testnet. * Add temporary fork-logic for testnet, which sets confirmedHash to null ...before fork activation. Otherwise we'd invalidate all DIP3 blocks on testnet. * Bump nTemporaryTestnetForkHeight to 273000
This commit is contained in:
parent
df7d12b41f
commit
d40a5ce31f
@ -378,6 +378,11 @@ public:
|
|||||||
// Testnet Dash BIP44 coin type is '1' (All coin's testnet default)
|
// Testnet Dash BIP44 coin type is '1' (All coin's testnet default)
|
||||||
nExtCoinType = 1;
|
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;
|
fMiningRequiresPeers = true;
|
||||||
fDefaultConsistencyChecks = false;
|
fDefaultConsistencyChecks = false;
|
||||||
fRequireStandard = false;
|
fRequireStandard = false;
|
||||||
|
@ -95,6 +95,11 @@ struct Params {
|
|||||||
int nMinimumDifficultyBlocks{0};
|
int nMinimumDifficultyBlocks{0};
|
||||||
int nHighSubsidyBlocks{0};
|
int nHighSubsidyBlocks{0};
|
||||||
int nHighSubsidyFactor{1};
|
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
|
} // namespace Consensus
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include "simplifiedmns.h"
|
#include "simplifiedmns.h"
|
||||||
#include "specialtx.h"
|
#include "specialtx.h"
|
||||||
|
|
||||||
|
#include "chainparams.h"
|
||||||
#include "univalue.h"
|
#include "univalue.h"
|
||||||
#include "validation.h"
|
#include "validation.h"
|
||||||
|
|
||||||
@ -71,6 +72,19 @@ bool CalcCbTxMerkleRootMNList(const CBlock& block, const CBlockIndex* pindexPrev
|
|||||||
}
|
}
|
||||||
|
|
||||||
CSimplifiedMNList sml(tmpMNList);
|
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;
|
bool mutated = false;
|
||||||
merkleRootRet = sml.CalcMerkleRoot(&mutated);
|
merkleRootRet = sml.CalcMerkleRoot(&mutated);
|
||||||
return !mutated;
|
return !mutated;
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
CSimplifiedMNListEntry::CSimplifiedMNListEntry(const CDeterministicMN& dmn) :
|
CSimplifiedMNListEntry::CSimplifiedMNListEntry(const CDeterministicMN& dmn) :
|
||||||
proRegTxHash(dmn.proTxHash),
|
proRegTxHash(dmn.proTxHash),
|
||||||
|
confirmedHash(dmn.pdmnState->confirmedHash),
|
||||||
service(dmn.pdmnState->addr),
|
service(dmn.pdmnState->addr),
|
||||||
pubKeyOperator(dmn.pdmnState->pubKeyOperator),
|
pubKeyOperator(dmn.pdmnState->pubKeyOperator),
|
||||||
keyIDVoting(dmn.pdmnState->keyIDVoting),
|
keyIDVoting(dmn.pdmnState->keyIDVoting),
|
||||||
|
Loading…
Reference in New Issue
Block a user