diff options
| author | Max K. <[email protected]> | 2015-07-28 00:30:28 +0200 |
|---|---|---|
| committer | Max K. <[email protected]> | 2015-07-28 00:30:28 +0200 |
| commit | 3ba610bc4126b2b7717a1d612b87d11566b98c2e (patch) | |
| tree | 5368cd349963752e3bfcd8d3970a1e51f1b5502d /src/main.cpp | |
| parent | Merge pull request #1201 from rnicoll/1.10-sync (diff) | |
| parent | Use block height 0 when checking for genesis block (diff) | |
| download | discoin-3ba610bc4126b2b7717a1d612b87d11566b98c2e.tar.xz discoin-3ba610bc4126b2b7717a1d612b87d11566b98c2e.zip | |
Merge pull request #1205 from rnicoll/1.10-genesis-checks
Use block height 0 when checking for genesis block
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index dfcd50310..ded32eb03 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2747,14 +2747,14 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& state, CBlockIndex * const pindexPrev) { const CChainParams& chainParams = Params(); - const Consensus::Params& consensusParams = chainParams.GetConsensus(pindexPrev->nHeight + 1); uint256 hash = block.GetHash(); - if (hash == consensusParams.hashGenesisBlock) + if (hash == chainParams.GetConsensus(0).hashGenesisBlock) return true; assert(pindexPrev); int nHeight = pindexPrev->nHeight+1; + const Consensus::Params& consensusParams = chainParams.GetConsensus(nHeight); // Disallow legacy blocks after merge-mining start. if (!consensusParams.fAllowLegacyBlocks |