From 49cccea035f063cd0a9d9a59e0dcf884de2b423b Mon Sep 17 00:00:00 2001 From: Antioch Peverell Date: Mon, 9 Nov 2020 17:11:27 +0000 Subject: [PATCH] on_block_accepted logging and webhooks all the time (#3486) --- servers/src/common/adapters.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/servers/src/common/adapters.rs b/servers/src/common/adapters.rs index 46dd8feae..e9b51ed68 100644 --- a/servers/src/common/adapters.rs +++ b/servers/src/common/adapters.rs @@ -737,11 +737,13 @@ where V: VerifierCache + 'static, { fn block_accepted(&self, b: &core::Block, status: BlockStatus, opts: Options) { - // not broadcasting blocks received through sync + // Trigger all registered "on_block_accepted" hooks (logging and webhooks). + for hook in &self.hooks { + hook.on_block_accepted(b, status); + } + + // Suppress broadcast of new blocks received during sync. if !opts.contains(chain::Options::SYNC) { - for hook in &self.hooks { - hook.on_block_accepted(b, status); - } // If we mined the block then we want to broadcast the compact block. // If we received the block from another node then broadcast "header first" // to minimize network traffic.