From 87e690420cb61efc172e82a29c38b479fc734247 Mon Sep 17 00:00:00 2001 From: alpaylan Date: Mon, 12 Apr 2021 19:59:52 +0300 Subject: six rightmost zeros for mining --- examples/mining.rs | 4 ++-- src/handlers.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/mining.rs b/examples/mining.rs index 56e33f3..c95c214 100644 --- a/examples/mining.rs +++ b/examples/mining.rs @@ -23,9 +23,9 @@ pub fn main() { let result = Blake2s::digest(&j); - let first_five = result[31] as i32 + result[30] as i32 + (result[29] << 4) as i32; + let first_six = result[31] as i32 + result[30] as i32 + result[29] as i32; - if first_five == 0 { + if first_six == 0 { println!("{} - {:x}\n{:?}", nonce, result, b); break; } 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