CryptoC-3: fix for Merkle tree root issue

This commit is contained in:
cryptonotefoundation 2014-09-05 13:46:10 +00:00
parent eefb4111cd
commit 6be8153a8b

View file

@ -19,7 +19,7 @@ void tree_hash(const char (*hashes)[HASH_SIZE], size_t count, char *root_hash) {
size_t i, j;
size_t cnt = count - 1;
char (*ints)[HASH_SIZE];
for (i = 1; i < sizeof(size_t); i <<= 1) {
for (i = 1; i < 8 * sizeof(size_t); i <<= 1) {
cnt |= cnt >> i;
}
cnt &= ~(cnt >> 1);