Skip to content

Commit

Permalink
Only log the propagating transactions when the transactions are non-e…
Browse files Browse the repository at this point in the history
…mpty

This can make the log cleaner, especially when you simply specify `--log sync=debug`.
  • Loading branch information
liuchengxu committed Aug 20, 2024
1 parent 73e2316 commit 485f6a3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion substrate/client/network/transactions/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 485f6a3

Please sign in to comment.