diff --git a/miner/src/miner.rs b/miner/src/miner.rs index 776cf7c83..6be2da512 100644 --- a/miner/src/miner.rs +++ b/miner/src/miner.rs @@ -133,19 +133,14 @@ impl MinerService for Miner { transactions, ); - match b { - None => { - *self.sealing_block.lock().unwrap() = None - }, - Some((block, invalid_transactions)) => { - let mut queue = self.transaction_queue.lock().unwrap(); - queue.remove_all( - &invalid_transactions.into_iter().collect::>(), - |a: &Address| chain.nonce(a) - ); - *self.sealing_block.lock().unwrap() = Some(block) - } - } + *self.sealing_block.lock().unwrap() = b.map(|(block, invalid_transactions)| { + let mut queue = self.transaction_queue.lock().unwrap(); + queue.remove_all( + &invalid_transactions.into_iter().collect::>(), + |a: &Address| chain.nonce(a) + ); + block + }); } fn sealing_block(&self, chain: &BlockChainClient) -> &Mutex> {