From 3c060b31fe26a753723b0ef1acf414ef18ddfb8e Mon Sep 17 00:00:00 2001 From: Ross Nicoll Date: Thu, 11 Jan 2018 21:04:33 +0000 Subject: Load AuxPoW blocks from index correctly (#1443) Load AuxPoW blocks from index correctly, by setting the version on the block before trying to check if it's AuxPoW. Previously the AuxPoW part of the block was never loaded because the check always failed. --- src/chain.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/chain.cpp') diff --git a/src/chain.cpp b/src/chain.cpp index e42d6497f..2ce98818f 100644 --- a/src/chain.cpp +++ b/src/chain.cpp @@ -14,6 +14,8 @@ CBlockHeader CBlockIndex::GetBlockHeader(const Consensus::Params& consensusParam { CBlockHeader block; + block.nVersion = nVersion; + /* The CBlockIndex object's block header is missing the auxpow. So if this is an auxpow block, read it from disk instead. We only have to read the actual *header*, not the full block. */ @@ -23,7 +25,6 @@ CBlockHeader CBlockIndex::GetBlockHeader(const Consensus::Params& consensusParam return block; } - block.nVersion = nVersion; if (pprev) block.hashPrevBlock = pprev->GetBlockHash(); block.hashMerkleRoot = hashMerkleRoot; -- cgit v1.2.3