Skip to content

Commit

Permalink
fix Epoch0 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
NaN-git committed Feb 12, 2018
1 parent db95dee commit 3bd580b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions algorithm/ethash.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ uint32_t EthCalcEpochNumber(uint8_t *SeedHash)
uint8_t TestSeedHash[32] = { 0 };

for(int Epoch = 0; Epoch < 2048; ++Epoch) {
SHA3_256((struct ethash_h256 *)TestSeedHash, TestSeedHash, 32);
if(!memcmp(TestSeedHash, SeedHash, 32)) return(Epoch + 1);
if (!memcmp(TestSeedHash, SeedHash, 32))
return Epoch;
SHA3_256(TestSeedHash, TestSeedHash, 32);
}

applog(LOG_ERR, "Error on epoch calculation.");
Expand Down

0 comments on commit 3bd580b

Please sign in to comment.