From b144bd2b845a12bfd445b4a38320efae596e6ed8 Mon Sep 17 00:00:00 2001 From: keorn Date: Mon, 19 Sep 2016 10:38:47 +0200 Subject: [PATCH] add tracing --- ethcore/src/client/client.rs | 2 ++ ethcore/src/miner/miner.rs | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ethcore/src/client/client.rs b/ethcore/src/client/client.rs index 24f93ce90..228751069 100644 --- a/ethcore/src/client/client.rs +++ b/ethcore/src/client/client.rs @@ -470,6 +470,7 @@ impl Client { /// Import transactions from the IO queue pub fn import_queued_transactions(&self, transactions: &[Bytes]) -> usize { + trace!(target: "external_tx", "Importing queued"); let _timer = PerfTimer::new("import_queued_transactions"); self.queue_transactions.fetch_sub(transactions.len(), AtomicOrdering::SeqCst); let txs = transactions.iter().filter_map(|bytes| UntrustedRlp::new(bytes).as_val().ok()).collect(); @@ -1060,6 +1061,7 @@ impl BlockChainClient for Client { let len = transactions.len(); match self.io_channel.send(ClientIoMessage::NewTransactions(transactions)) { Ok(_) => { + trace!(target: "external_tx", "Sending IoMessage"); self.queue_transactions.fetch_add(len, AtomicOrdering::SeqCst); } Err(e) => { diff --git a/ethcore/src/miner/miner.rs b/ethcore/src/miner/miner.rs index 4e2774da1..931246965 100644 --- a/ethcore/src/miner/miner.rs +++ b/ethcore/src/miner/miner.rs @@ -78,7 +78,7 @@ impl Default for MinerOptions { MinerOptions { new_work_notify: vec![], force_sealing: false, - reseal_on_external_tx: false, + reseal_on_external_tx: true, reseal_on_own_tx: true, tx_gas_limit: !U256::zero(), tx_queue_size: 1024, @@ -397,6 +397,7 @@ impl Miner { if !block.transactions().is_empty() { if let Ok(sealed) = self.seal_block_internally(block) { if chain.import_block(sealed.rlp_bytes()).is_ok() { + trace!(target: "miner", "import_block_internally: imported internally sealed block"); return true } } @@ -659,7 +660,7 @@ impl MinerService for Miner { chain: &MiningBlockChainClient, transactions: Vec ) -> Vec> { - + trace!(target: "external_tx", "Importing external transactions"); let results = { let mut transaction_queue = self.transaction_queue.lock(); self.add_transactions_to_queue(