From decb430d8292c9957e03e70acab33668a1e499c2 Mon Sep 17 00:00:00 2001 From: Revertron Date: Fri, 19 Mar 2021 14:25:11 +0100 Subject: [PATCH] Small fix in miner. --- src/miner.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/miner.rs b/src/miner.rs index 30d4163..85e8e7b 100644 --- a/src/miner.rs +++ b/src/miner.rs @@ -204,10 +204,11 @@ impl Miner { fn find_hash(context: Arc>, digest: &mut dyn Digest, mut block: Block, running: Arc, top_block: Arc) -> Option { let mut buf: [u8; 32] = [0; 32]; let difficulty = block.difficulty as usize; + let full = block.transaction.is_some(); loop { block.random = rand::random(); block.index = context.lock().unwrap().chain.height() + 1; - if context.lock().unwrap().chain.next_allowed_block() > block.index { + if full && context.lock().unwrap().chain.next_allowed_block() > block.index { // We can't mine now, as we need to wait for block to be signed thread::sleep(Duration::from_millis(1000)); continue;