diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-01-18 19:23:05 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-03-06 17:21:59 +0100 |
commit | a0ae79d77552d9ee67469c934458a3f3bd170858 (patch) | |
tree | e52428f7cb819fddbdc8b801ea3894306e266d85 /src/primitives/block.cpp | |
parent | 62b30f09acae20f83dfb7995fa8b221c35e2fbff (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.cpp | 13 |
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 |