From 493f02ba2a51dcf9a97a6a0a4cb8733ef4c097d3 Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Mon, 8 Jan 2018 20:23:41 +0000 Subject: Always use parameters at block 0 to get genesis block hash (#1416) This doesn't actually change behaviour, but stylistically is more correct. --- src/validation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/validation.cpp') diff --git a/src/validation.cpp b/src/validation.cpp index 13f98cdaa..240edafda 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1782,7 +1782,7 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin // Special case for the genesis block, skipping connection of its transactions // (its coinbase is unspendable) - if (block.GetHash() == consensus.hashGenesisBlock) { + if (block.GetHash() == Params().GetConsensus(0).hashGenesisBlock) { if (!fJustCheck) view.SetBestBlock(pindex->GetBlockHash()); return true; @@ -2934,7 +2934,7 @@ bool CheckBlock(const CBlock& block, CValidationState& state, bool fCheckPOW, bo static bool CheckIndexAgainstCheckpoint(const CBlockIndex* pindexPrev, CValidationState& state, const CChainParams& chainparams, const uint256& hash) { - if (*pindexPrev->phashBlock == chainparams.GetConsensus(pindexPrev->nHeight + 1).hashGenesisBlock) + if (*pindexPrev->phashBlock == chainparams.GetConsensus(0).hashGenesisBlock) return true; int nHeight = pindexPrev->nHeight+1; -- cgit v1.2.3