Merge #8348: Trivial: Segwit: Don't call IsWitnessEnabled from ContextualCheckBlock

38c4c8b Trivial: Segwit: Don't call IsWitnessEnabled from ContextualCheckBlock (Jorge Timón)
This commit is contained in:
Wladimir J. van der Laan 2016-07-28 09:50:46 +02:00
commit 64d660a43f
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6

View File

@ -3567,7 +3567,7 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, const CB
// {0xaa, 0x21, 0xa9, 0xed}, and the following 32 bytes are SHA256^2(witness root, witness nonce). In case there are // {0xaa, 0x21, 0xa9, 0xed}, and the following 32 bytes are SHA256^2(witness root, witness nonce). In case there are
// multiple, the last one is used. // multiple, the last one is used.
bool fHaveWitness = false; bool fHaveWitness = false;
if (IsWitnessEnabled(pindexPrev, consensusParams)) { if (VersionBitsState(pindexPrev, consensusParams, Consensus::DEPLOYMENT_SEGWIT, versionbitscache) == THRESHOLD_ACTIVE) {
int commitpos = GetWitnessCommitmentIndex(block); int commitpos = GetWitnessCommitmentIndex(block);
if (commitpos != -1) { if (commitpos != -1) {
bool malleated = false; bool malleated = false;