From 485f6a3e9a715f615eb6a8c5c72f8f6fa7c2040e Mon Sep 17 00:00:00 2001 From: Liu-Cheng Xu Date: Tue, 20 Aug 2024 23:50:11 +0800 Subject: [PATCH] Only log the propagating transactions when the transactions are non-empty This can make the log cleaner, especially when you simply specify `--log sync=debug`. --- substrate/client/network/transactions/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/substrate/client/network/transactions/src/lib.rs b/substrate/client/network/transactions/src/lib.rs index 31ad0781035e..a241041968fd 100644 --- a/substrate/client/network/transactions/src/lib.rs +++ b/substrate/client/network/transactions/src/lib.rs @@ -522,8 +522,14 @@ where return } - debug!(target: LOG_TARGET, "Propagating transactions"); let transactions = self.transaction_pool.transactions(); + + if transactions.is_empty() { + return + } + + debug!(target: LOG_TARGET, "Propagating transactions"); + let propagated_to = self.do_propagate_transactions(&transactions); self.transaction_pool.on_broadcasted(propagated_to); }