From fa02b3ae54866e8972bd3407acf6385549d3f25e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Drwi=C4=99ga?= Date: Tue, 24 Jan 2017 20:18:52 +0100 Subject: [PATCH] Additional logs for own transactions (#4278) --- ethcore/src/evm/interpreter/mod.rs | 1 - ethcore/src/miner/local_transactions.rs | 7 +++++++ ethcore/src/miner/miner.rs | 5 +---- rpc/src/v1/helpers/signing_queue.rs | 3 --- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ethcore/src/evm/interpreter/mod.rs b/ethcore/src/evm/interpreter/mod.rs index b10bf3246..e22197df0 100644 --- a/ethcore/src/evm/interpreter/mod.rs +++ b/ethcore/src/evm/interpreter/mod.rs @@ -37,7 +37,6 @@ use bit_set::BitSet; use util::*; -type CodePosition = usize; type ProgramCounter = usize; const ONE: U256 = U256([1, 0, 0, 0]); diff --git a/ethcore/src/miner/local_transactions.rs b/ethcore/src/miner/local_transactions.rs index 62cec7151..1bd551a0b 100644 --- a/ethcore/src/miner/local_transactions.rs +++ b/ethcore/src/miner/local_transactions.rs @@ -70,36 +70,43 @@ impl LocalTransactionsList { } pub fn mark_pending(&mut self, hash: H256) { + debug!(target: "own_tx", "Imported to Current (hash {:?})", hash); self.clear_old(); self.transactions.insert(hash, Status::Pending); } pub fn mark_future(&mut self, hash: H256) { + debug!(target: "own_tx", "Imported to Future (hash {:?})", hash); self.transactions.insert(hash, Status::Future); self.clear_old(); } pub fn mark_rejected(&mut self, tx: SignedTransaction, err: TransactionError) { + debug!(target: "own_tx", "Transaction rejected (hash {:?}): {:?}", tx.hash(), err); self.transactions.insert(tx.hash(), Status::Rejected(tx, err)); self.clear_old(); } pub fn mark_replaced(&mut self, tx: SignedTransaction, gas_price: U256, hash: H256) { + debug!(target: "own_tx", "Transaction replaced (hash {:?}) by {:?} (new gas price: {:?})", tx.hash(), hash, gas_price); self.transactions.insert(tx.hash(), Status::Replaced(tx, gas_price, hash)); self.clear_old(); } pub fn mark_invalid(&mut self, tx: SignedTransaction) { + warn!(target: "own_tx", "Transaction marked invalid (hash {:?})", tx.hash()); self.transactions.insert(tx.hash(), Status::Invalid(tx)); self.clear_old(); } pub fn mark_dropped(&mut self, tx: SignedTransaction) { + warn!(target: "own_tx", "Transaction dropped (hash {:?})", tx.hash()); self.transactions.insert(tx.hash(), Status::Dropped(tx)); self.clear_old(); } pub fn mark_mined(&mut self, tx: SignedTransaction) { + info!(target: "own_tx", "Transaction mined (hash {:?})", tx.hash()); self.transactions.insert(tx.hash(), Status::Mined(tx)); self.clear_old(); } diff --git a/ethcore/src/miner/miner.rs b/ethcore/src/miner/miner.rs index 2a4784ae6..8885432b5 100644 --- a/ethcore/src/miner/miner.rs +++ b/ethcore/src/miner/miner.rs @@ -873,7 +873,6 @@ impl MinerService for Miner { pending: PendingTransaction, ) -> Result { - let hash = pending.transaction.hash(); trace!(target: "own_tx", "Importing transaction: {:?}", pending); let imported = { @@ -885,12 +884,10 @@ impl MinerService for Miner { ).pop().expect("one result returned per added transaction; one added => one result; qed"); match import { - Ok(ref res) => { - trace!(target: "own_tx", "Imported transaction to {:?} (hash: {:?})", res, hash); + Ok(_) => { trace!(target: "own_tx", "Status: {:?}", transaction_queue.status()); }, Err(ref e) => { - trace!(target: "own_tx", "Failed to import transaction {:?} (hash: {:?})", e, hash); trace!(target: "own_tx", "Status: {:?}", transaction_queue.status()); warn!(target: "own_tx", "Error importing transaction: {:?}", e); }, diff --git a/rpc/src/v1/helpers/signing_queue.rs b/rpc/src/v1/helpers/signing_queue.rs index 58b3740cf..4120522ba 100644 --- a/rpc/src/v1/helpers/signing_queue.rs +++ b/rpc/src/v1/helpers/signing_queue.rs @@ -54,9 +54,6 @@ pub enum QueueAddError { LimitReached, } -/// Message Receiver type -pub type QueueEventReceiver = mpsc::Receiver; - // TODO [todr] to consider: timeout instead of limit? const QUEUE_LIMIT: usize = 50;