diff options
| author | Ross Nicoll <[email protected]> | 2018-01-11 21:04:33 +0000 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2018-09-19 21:09:16 +0100 |
| commit | 3c060b31fe26a753723b0ef1acf414ef18ddfb8e (patch) | |
| tree | 54ce70cabe25224991b9aca7fd0ced49ecd7f3ed /src/chain.cpp | |
| parent | Initialise left/right consensus branches to null (#1435) (diff) | |
| download | discoin-3c060b31fe26a753723b0ef1acf414ef18ddfb8e.tar.xz discoin-3c060b31fe26a753723b0ef1acf414ef18ddfb8e.zip | |
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.
Diffstat (limited to 'src/chain.cpp')
| -rw-r--r-- | src/chain.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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; |