Skip to content

Commit

Permalink
Only log when the transaction is actually to be propagated (paritytec…
Browse files Browse the repository at this point in the history
…h#12158)

The logging before is confusing as it says Propagating but it's not in fact when gossip_enabled is
false. Now it's also consistent with `propagate_transactions` below.
  • Loading branch information
liuchengxu authored Aug 31, 2022
1 parent 7c1a39f commit 435218f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/network/src/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -425,11 +425,11 @@ impl<B: BlockT + 'static, H: ExHashT> TransactionsHandler<B, H> {

/// Propagate one transaction.
pub fn propagate_transaction(&mut self, hash: &H) {
debug!(target: "sync", "Propagating transaction [{:?}]", hash);
// Accept transactions only when enabled
if !self.gossip_enabled.load(Ordering::Relaxed) {
return
}
debug!(target: "sync", "Propagating transaction [{:?}]", hash);
if let Some(transaction) = self.transaction_pool.transaction(hash) {
let propagated_to = self.do_propagate_transactions(&[(hash.clone(), transaction)]);
self.transaction_pool.on_broadcasted(propagated_to);
Expand Down

0 comments on commit 435218f

Please sign in to comment.