Skip to content

Commit fe2727b

Browse files
committed
src/hash.cpp: endian compatibility
backports bitcoin/bitcoin@3ca5852
1 parent 440c8f5 commit fe2727b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/hash.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

66
#include "hash.h"
7+
#include "crypto/common.h"
78
#include "crypto/hmac_sha512.h"
89
#include "crypto/scrypt.h"
910

@@ -24,10 +25,10 @@ unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector<unsigned char
2425

2526
//----------
2627
// body
27-
const uint32_t* blocks = (const uint32_t*)(&vDataToHash[0] + nblocks * 4);
28+
const uint8_t* blocks = &vDataToHash[0] + nblocks * 4;
2829

2930
for (int i = -nblocks; i; i++) {
30-
uint32_t k1 = blocks[i];
31+
uint32_t k1 = ReadLE32(blocks + i*4);
3132

3233
k1 *= c1;
3334
k1 = ROTL32(k1, 15);

0 commit comments

Comments
 (0)