diff options
author | alpaylan | 2021-04-12 19:59:52 +0300 |
---|---|---|
committer | alpaylan | 2021-04-12 19:59:52 +0300 |
commit | df484d87424674b88ccfa9392cfa9a75cc4abe48 (patch) | |
tree | d0f65d9aff8967a3b99d6f828c32366b94e64758 /src/handlers.rs | |
parent | 8e3d17476566565449cfc952f28c5740e474e94f (diff) | |
download | gradecoin-df484d87424674b88ccfa9392cfa9a75cc4abe48.tar.gz gradecoin-df484d87424674b88ccfa9392cfa9a75cc4abe48.tar.bz2 gradecoin-df484d87424674b88ccfa9392cfa9a75cc4abe48.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 |