From f538ec25685fd027299bb07d482b93d8f457d9cf Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Fri, 16 Apr 2021 02:24:28 +0300 Subject: Check correct bits --- src/handlers.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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( return Ok(warp::reply::with_status(res_json, StatusCode::BAD_REQUEST)); } - // Are the 6 rightmost characters (=24 bits) zero? - let should_zero = hashvalue[31] as i32 + hashvalue[30] as i32 + hashvalue[29] as i32; + // Are the 6 leftmost characters (=24 bits) zero? + let should_zero = hashvalue[0] as i32 + hashvalue[1] as i32 + hashvalue[2] as i32; if should_zero != 0 { debug!("the hash does not have 6 rightmost zero bits"); -- cgit v1.2.3-70-g09d2