diff options
author | Yigit Sever | 2021-04-16 02:24:28 +0300 |
---|---|---|
committer | Yigit Sever | 2021-04-16 02:24:28 +0300 |
commit | fe1005c32efc4a57cb4fc5e3dba264eaed000370 (patch) | |
tree | 0f3d99f6252362a41daaaad369ab41b71fab44ce /src/handlers.rs | |
parent | af32e933e96e0c419c488f12c5e3b325fc8bd9fc (diff) | |
download | gradecoin-fe1005c32efc4a57cb4fc5e3dba264eaed000370.tar.gz gradecoin-fe1005c32efc4a57cb4fc5e3dba264eaed000370.tar.bz2 gradecoin-fe1005c32efc4a57cb4fc5e3dba264eaed000370.zip |
Check correct bits
Diffstat (limited to 'src/handlers.rs')
-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"); |