Merge pull request #924

61ed40a Tests: fix signed/unsigned comparison in hash-target (anonimal)
This commit is contained in:
Riccardo Spagni 2016-07-23 09:03:55 +02:00
commit 3720c27b7d
No known key found for this signature in database
GPG Key ID: 55432DF31CCD4FCD

View File

@ -41,7 +41,7 @@ using cryptonote::check_hash;
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
crypto::hash h; crypto::hash h;
for (uint64_t diff = 1;; diff += 1 + (diff >> 8)) { for (uint64_t diff = 1;; diff += 1 + (diff >> 8)) {
for (int b = 0; b < 256; b++) { for (uint16_t b = 0; b < 256; b++) {
memset(&h, b, sizeof(crypto::hash)); memset(&h, b, sizeof(crypto::hash));
if (check_hash(h, diff) != (b == 0 || diff <= 255 / b)) { if (check_hash(h, diff) != (b == 0 || diff <= 255 / b)) {
return 1; return 1;