From 1def165c0b1878be6fbfee1d0432155b3cac374a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Mon, 23 May 2016 18:47:11 +0200 Subject: [PATCH] Adding info messages on mined blocks (#1127) --- miner/src/miner.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/miner/src/miner.rs b/miner/src/miner.rs index ed3c976c0..19869229f 100644 --- a/miner/src/miner.rs +++ b/miner/src/miner.rs @@ -459,15 +459,18 @@ impl MinerService for Miner { if let Some(b) = self.sealing_work.lock().unwrap().take_used_if(|b| &b.hash() == &pow_hash) { match chain.try_seal(b.lock(), seal) { Err(_) => { + info!(target: "miner", "Mined block rejected, PoW was invalid."); Err(Error::PowInvalid) } Ok(sealed) => { + info!(target: "miner", "New block mined, hash: {}", sealed.header().hash()); // TODO: commit DB from `sealed.drain` and make a VerifiedBlock to skip running the transactions twice. try!(chain.import_block(sealed.rlp_bytes())); Ok(()) } } } else { + info!(target: "miner", "Mined block rejected, PoW hash invalid or out of date."); Err(Error::PowHashInvalid) } }