diff options
author | Yigit Sever | 2021-04-16 02:24:28 +0300 |
---|---|---|
committer | Yigit Sever | 2021-04-16 02:24:28 +0300 |
commit | f538ec25685fd027299bb07d482b93d8f457d9cf (patch) | |
tree | ae66b230dddd99971a09e08c7c612e14750ed04a /src | |
parent | bf42107c74aa9277fd7301c960e3e70efafbe046 (diff) | |
download | gradecoin-f538ec25685fd027299bb07d482b93d8f457d9cf.tar.gz gradecoin-f538ec25685fd027299bb07d482b93d8f457d9cf.tar.bz2 gradecoin-f538ec25685fd027299bb07d482b93d8f457d9cf.zip |
Check correct bits
Diffstat (limited to 'src')
-rw-r--r-- | src/handlers.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/handlers.rs b/src/handlers.rs index fe60ded..482f5b1 100644 --- a/src/handlers.rs +++ b/src/handlers.rs | |||
@@ -437,8 +437,8 @@ pub async fn authorized_propose_block( | |||
437 | return Ok(warp::reply::with_status(res_json, StatusCode::BAD_REQUEST)); | 437 | return Ok(warp::reply::with_status(res_json, StatusCode::BAD_REQUEST)); |
438 | } | 438 | } |
439 | 439 | ||
440 | // Are the 6 rightmost characters (=24 bits) zero? | 440 | // Are the 6 leftmost characters (=24 bits) zero? |
441 | let should_zero = hashvalue[31] as i32 + hashvalue[30] as i32 + hashvalue[29] as i32; | 441 | let should_zero = hashvalue[0] as i32 + hashvalue[1] as i32 + hashvalue[2] as i32; |
442 | 442 | ||
443 | if should_zero != 0 { | 443 | if should_zero != 0 { |
444 | debug!("the hash does not have 6 rightmost zero bits"); | 444 | debug!("the hash does not have 6 rightmost zero bits"); |