diff options
author | alpaylan | 2021-04-12 19:59:52 +0300 |
---|---|---|
committer | alpaylan | 2021-04-12 19:59:52 +0300 |
commit | 87e690420cb61efc172e82a29c38b479fc734247 (patch) | |
tree | 56da2a59de903d43b4b32d361e4a89a8d2c51669 /src/handlers.rs | |
parent | 364ee376ea5c6fa0de8bb40ee1e7304d05d4bf64 (diff) | |
download | gradecoin-87e690420cb61efc172e82a29c38b479fc734247.tar.gz gradecoin-87e690420cb61efc172e82a29c38b479fc734247.tar.bz2 gradecoin-87e690420cb61efc172e82a29c38b479fc734247.zip |
six rightmost zeros for mining
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 6edc96f..38bd459 100644 --- a/src/handlers.rs +++ b/src/handlers.rs | |||
@@ -137,8 +137,8 @@ pub async fn propose_block(new_block: Block, db: Db) -> Result<impl warp::Reply, | |||
137 | let hashvalue = Blake2s::digest(&naked_block_flat); | 137 | let hashvalue = Blake2s::digest(&naked_block_flat); |
138 | let hash_string = format!("{:x}", hashvalue); | 138 | let hash_string = format!("{:x}", hashvalue); |
139 | 139 | ||
140 | // 5 rightmost bits are zero | 140 | // 6 rightmost bits are zero |
141 | let should_zero = hashvalue[31] as i32 + hashvalue[30] as i32 + (hashvalue[29] << 4) as i32; | 141 | let should_zero = hashvalue[31] as i32 + hashvalue[30] as i32 + hashvalue[29] as i32; |
142 | 142 | ||
143 | if should_zero == 0 { | 143 | if should_zero == 0 { |
144 | // one last check to see if block is telling the truth | 144 | // one last check to see if block is telling the truth |