From d622fdfd76619a399c7e7add24188e56a64b1b52 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 6 May 2015 12:37:05 +0200 Subject: [PATCH] Adding Block verification tests - The data for the block verification come from the POC-9 testnet. - Also using boolean instead of int in check_difficulty for the verification --- internal.c | 2 +- internal.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal.c b/internal.c index 607e44138..e881e0c7b 100644 --- a/internal.c +++ b/internal.c @@ -280,7 +280,7 @@ ethash_h256_t ethash_get_seedhash(uint64_t block_number) return ret; } -int ethash_quick_check_difficulty( +bool ethash_quick_check_difficulty( ethash_h256_t const* header_hash, uint64_t const nonce, ethash_h256_t const* mix_hash, diff --git a/internal.h b/internal.h index 221ff290a..4e2b695ac 100644 --- a/internal.h +++ b/internal.h @@ -47,7 +47,7 @@ static inline void ethash_h256_reset(ethash_h256_t* hash) } // Returns if hash is less than or equal to difficulty -static inline int ethash_check_difficulty( +static inline bool ethash_check_difficulty( ethash_h256_t const* hash, ethash_h256_t const* difficulty ) @@ -59,10 +59,10 @@ static inline int ethash_check_difficulty( } return ethash_h256_get(hash, i) < ethash_h256_get(difficulty, i); } - return 1; + return true; } -int ethash_quick_check_difficulty( +bool ethash_quick_check_difficulty( ethash_h256_t const* header_hash, uint64_t const nonce, ethash_h256_t const* mix_hash,