aboutsummaryrefslogtreecommitdiff
path: root/src/primitives/block.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-01-18 19:23:05 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-03-06 17:21:59 +0100
commita0ae79d77552d9ee67469c934458a3f3bd170858 (patch)
treee52428f7cb819fddbdc8b801ea3894306e266d85 /src/primitives/block.cpp
parent62b30f09acae20f83dfb7995fa8b221c35e2fbff (diff)
Replace CBlockHeader::GetHash with call to SerializeHash
Removes variability between LE and BE. As suggested by @sipa.
Diffstat (limited to 'src/primitives/block.cpp')
-rw-r--r--src/primitives/block.cpp13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/primitives/block.cpp b/src/primitives/block.cpp
index 8338762a38..5b9c13d870 100644
--- a/src/primitives/block.cpp
+++ b/src/primitives/block.cpp
@@ -12,18 +12,7 @@
uint256 CBlockHeader::GetHash() const
{
-#if defined(WORDS_BIGENDIAN)
- uint8_t data[80];
- WriteLE32(&data[0], nVersion);
- memcpy(&data[4], hashPrevBlock.begin(), hashPrevBlock.size());
- memcpy(&data[36], hashMerkleRoot.begin(), hashMerkleRoot.size());
- WriteLE32(&data[68], nTime);
- WriteLE32(&data[72], nBits);
- WriteLE32(&data[76], nNonce);
- return Hash(data, data + 80);
-#else // Can take shortcut for little endian
- return Hash(BEGIN(nVersion), END(nNonce));
-#endif
+ return SerializeHash(*this);
}
uint256 CBlock::BuildMerkleTree(bool* fMutated) const