From f85715dbc2aee48558376d360b070c00872c3259 Mon Sep 17 00:00:00 2001 From: keroro Date: Mon, 19 Jul 2021 12:41:27 +0800 Subject: [PATCH] chore: log failed transactions results --- tx-pool/src/process.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tx-pool/src/process.rs b/tx-pool/src/process.rs index 7abacc0071..964f238d09 100644 --- a/tx-pool/src/process.rs +++ b/tx-pool/src/process.rs @@ -969,11 +969,15 @@ impl TxPoolService { let total = txs.len(); let mut count = 0usize; for tx in txs { - if self._process_tx(tx, None).await.is_err() { + let tx_hash = tx.hash(); + if let Err(err) = self._process_tx(tx, None).await { + error!("failed to process {:#x}, error: {:?}", tx_hash, err); count += 1; } } - info!("{}/{} transactions are failed to process", count, total); + if count != 0 { + info!("{}/{} transactions are failed to process", count, total); + } } pub(crate) async fn clear_pool(&mut self, new_snapshot: Arc) {