diff options
| author | Max K <[email protected]> | 2019-07-14 19:35:30 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-07-14 19:35:30 +0200 |
| commit | cee13699a5676355487f8eb2d91985f63438eae4 (patch) | |
| tree | cf12be6180f950a25ee2ee7f3f2126542835d6e3 /src/chain.h | |
| parent | Correct build and test net seed (diff) | |
| parent | Handle legacy v2 block at #66064 (diff) | |
| download | discoin-1.17-dev.tar.xz discoin-1.17-dev.zip | |
Merge pull request #1546 from rnicoll/1.17-auxpow1.17-dev
1.17 AuxPoW support
Diffstat (limited to 'src/chain.h')
| -rw-r--r-- | src/chain.h | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/src/chain.h b/src/chain.h index 34879d576..ca10f4449 100644 --- a/src/chain.h +++ b/src/chain.h @@ -213,9 +213,6 @@ public: uint32_t nBits; uint32_t nNonce; - // Dogecoin: Keep the Scrypt hash as well as SHA256 - uint256 hashBlockPoW; - //! (memory only) Sequential id assigned to distinguish order in which blocks are received. int32_t nSequenceId; @@ -243,7 +240,6 @@ public: nTime = 0; nBits = 0; nNonce = 0; - hashBlockPoW = uint256(); } CBlockIndex() @@ -260,7 +256,6 @@ public: nTime = block.nTime; nBits = block.nBits; nNonce = block.nNonce; - hashBlockPoW = block.GetPoWHash(); } CDiskBlockPos GetBlockPos() const { @@ -281,29 +276,13 @@ public: return ret; } - CBlockHeader GetBlockHeader() const - { - CBlockHeader block; - block.nVersion = nVersion; - if (pprev) - block.hashPrevBlock = pprev->GetBlockHash(); - block.hashMerkleRoot = hashMerkleRoot; - block.nTime = nTime; - block.nBits = nBits; - block.nNonce = nNonce; - return block; - } + CBlockHeader GetBlockHeader(const Consensus::Params& consensusParams) const; uint256 GetBlockHash() const { return *phashBlock; } - uint256 GetBlockPoWHash() const - { - return hashBlockPoW; - } - int64_t GetBlockTime() const { return (int64_t)nTime; @@ -367,6 +346,13 @@ public: //! Efficiently find an ancestor of this block. CBlockIndex* GetAncestor(int height); const CBlockIndex* GetAncestor(int height) const; + + /* Analyse the block version. */ + inline int GetBaseVersion() const + { + return CPureBlockHeader::GetBaseVersion(nVersion); + } + }; arith_uint256 GetBlockProof(const CBlockIndex& block); @@ -415,7 +401,6 @@ public: READWRITE(nTime); READWRITE(nBits); READWRITE(nNonce); - READWRITE(hashBlockPoW); } uint256 GetBlockHash() const |