diff --git a/tx-pool/src/block_assembler/mod.rs b/tx-pool/src/block_assembler/mod.rs index a21319fc5c..381a263790 100644 --- a/tx-pool/src/block_assembler/mod.rs +++ b/tx-pool/src/block_assembler/mod.rs @@ -632,6 +632,9 @@ impl BlockAssembler { } pub(crate) async fn notify(&self) { + if !self.need_to_notify() { + return; + } let template = self.get_current().await; if let Ok(template_json) = serde_json::to_string(&template) { let notify_timeout = Duration::from_millis(self.config.notify_timeout_millis); @@ -687,6 +690,10 @@ impl BlockAssembler { } } } + + fn need_to_notify(&self) -> bool { + !self.config.notify.is_empty() || !self.config.notify_scripts.is_empty() + } } #[derive(Clone)]