mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-20 19:11:08 +03:00
on_block_accepted logging and webhooks all the time (#3486)
This commit is contained in:
parent
25fcefada2
commit
49cccea035
1 changed files with 6 additions and 4 deletions
|
@ -737,11 +737,13 @@ where
|
||||||
V: VerifierCache + 'static,
|
V: VerifierCache + 'static,
|
||||||
{
|
{
|
||||||
fn block_accepted(&self, b: &core::Block, status: BlockStatus, opts: Options) {
|
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) {
|
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 mined the block then we want to broadcast the compact block.
|
||||||
// If we received the block from another node then broadcast "header first"
|
// If we received the block from another node then broadcast "header first"
|
||||||
// to minimize network traffic.
|
// to minimize network traffic.
|
||||||
|
|
Loading…
Reference in a new issue