From dd558464a543d71c16aaae739069d77a7ff57d83 Mon Sep 17 00:00:00 2001 From: Revertron Date: Sun, 18 Apr 2021 18:05:33 +0200 Subject: [PATCH] Fixed ability to stop mining if we are waiting for signing blocks in miner. --- Cargo.toml | 2 +- src/miner.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5ebbb5b..9709489 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "alfis" -version = "0.4.10" +version = "0.4.11" authors = ["Revertron "] edition = "2018" build = "build.rs" diff --git a/src/miner.rs b/src/miner.rs index 75a4d2d..5e1c0fe 100644 --- a/src/miner.rs +++ b/src/miner.rs @@ -232,6 +232,9 @@ fn find_hash(context: Arc>, mut block: Block, running: Arc block.index { + if !running.load(Ordering::Relaxed) { + return None; + } //trace!("Mining full block is not allowed until previous is not signed"); // We can't mine now, as we need to wait for block to be signed thread::sleep(Duration::from_millis(5000));