From 16c9f9036b41f96d87ecb143d6d5f8b52850ac1e Mon Sep 17 00:00:00 2001 From: Leo Date: Fri, 29 Oct 2021 22:26:33 +0200 Subject: [PATCH] node/pkg/processor: change threshold for Discord notifications Change-Id: I09060ad46a47b6293b18cffd717492098ad6dda0 --- node/pkg/processor/cleanup.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/node/pkg/processor/cleanup.go b/node/pkg/processor/cleanup.go index 4d9613e6..40367792 100644 --- a/node/pkg/processor/cleanup.go +++ b/node/pkg/processor/cleanup.go @@ -101,11 +101,15 @@ func (p *Processor) handleCleanup(ctx context.Context) { } } - go func(v *vaa.VAA, hasSigs, wantSigs int, quorum bool, missing []string) { - if err := p.notifier.MissingSignaturesOnTransaction(v, hasSigs, wantSigs, quorum, missing); err != nil { - p.logger.Error("failed to send notification", zap.Error(err)) - } - }(s.ourVAA, hasSigs, wantSigs, quorum, missing) + // Send notification for individual message when quorum has failed or + // more than one node is missing. + if !quorum || len(missing) > 1 { + go func(v *vaa.VAA, hasSigs, wantSigs int, quorum bool, missing []string) { + if err := p.notifier.MissingSignaturesOnTransaction(v, hasSigs, wantSigs, quorum, missing); err != nil { + p.logger.Error("failed to send notification", zap.Error(err)) + } + }(s.ourVAA, hasSigs, wantSigs, quorum, missing) + } } }