Skip to content

Commit

Permalink
grin v5.3 (0003) on_block_accepted logging and webhooks all the time (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
bayk committed Jun 7, 2024
1 parent 363422e commit 4ef5646
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions servers/src/common/adapters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -967,11 +967,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.
Expand Down

0 comments on commit 4ef5646

Please sign in to comment.