Skip to content

Commit

Permalink
Fixed bug with encoder
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-andersen committed Feb 4, 2014
1 parent 4e060dd commit 94a2205
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/momentum.cpp
Expand Up @@ -119,15 +119,16 @@ namespace bts

void generate_hashes(pow_seed_type head, uint64_t *hashStore, uint32_t *hashCounts)
{
fc::sha512::encoder enc;
for ( uint32_t n = 0; n < MAX_MOMENTUM_NONCE; n += (BIRTHDAYS_PER_HASH)) {
fc::sha512::encoder enc;
enc.write( (char*)&n, sizeof(n));
enc.write( (char *)&head, sizeof(head));
auto result = enc.result();

for (uint32_t i = 0; i < BIRTHDAYS_PER_HASH; i++) {
put_hash_in_bucket((result._hash[i] >> (64 - SEARCH_SPACE_BITS)), hashStore, hashCounts, n+i);
}
enc.reset();
}
}

Expand Down

0 comments on commit 94a2205

Please sign in to comment.