From f14931a0d4b221d2fc686db8b6c6cb65be5e9de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gianguido=20Sor=C3=A0?= Date: Wed, 19 Jul 2023 15:26:14 +0200 Subject: [PATCH] core/priority: don't start consensus twice (#2447) If consensus has been started because enough messages have been received, don't also start it if exchangeTimeout is reached. category: bug ticket: #2439 --- core/priority/prioritiser.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/priority/prioritiser.go b/core/priority/prioritiser.go index 180b24295..f31290f07 100644 --- a/core/priority/prioritiser.go +++ b/core/priority/prioritiser.go @@ -303,6 +303,10 @@ func runInstance(ctx context.Context, duty core.Duty, own *pbv1.PriorityMsg, case msg := <-responses: addMsg(msg) case <-exTimeout: + if consStarted { + continue + } + log.Debug(ctx, "Priority protocol instance exchange timeout, starting consensus") consStarted = true err := startConsensus(ctx, duty, msgs, minRequired, consensus)