Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions src/primitives/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class CBlockHeader
int32_t nVersion;
uint256 hashPrevBlock;
uint256 hashMerkleRoot;
uint256 hashWitnessMerkleRoot;
uint32_t nTime;
uint32_t nBits;
uint32_t nNonce;
Expand All @@ -40,6 +41,7 @@ class CBlockHeader
READWRITE(this->nVersion);
READWRITE(hashPrevBlock);
READWRITE(hashMerkleRoot);
READWRITE(hashWitnessMerkleRoot);
READWRITE(nTime);
READWRITE(nBits);
READWRITE(nNonce);
Expand All @@ -50,6 +52,7 @@ class CBlockHeader
nVersion = 0;
hashPrevBlock.SetNull();
hashMerkleRoot.SetNull();
hashWitnessMerkleRoot.SetNull();
nTime = 0;
nBits = 0;
nNonce = 0;
Expand Down Expand Up @@ -112,12 +115,13 @@ class CBlock : public CBlockHeader
CBlockHeader GetBlockHeader() const
{
CBlockHeader block;
block.nVersion = nVersion;
block.hashPrevBlock = hashPrevBlock;
block.hashMerkleRoot = hashMerkleRoot;
block.nTime = nTime;
block.nBits = nBits;
block.nNonce = nNonce;
block.nVersion = nVersion;
block.hashPrevBlock = hashPrevBlock;
block.hashMerkleRoot = hashMerkleRoot;
block.hashWitnessMerkleRoot = hashWitnessMerkleRoot;
block.nTime = nTime;
block.nBits = nBits;
block.nNonce = nNonce;
return block;
}

Expand Down