From 452a323a22a734d796cd8e014934d684b8da449a Mon Sep 17 00:00:00 2001 From: pfi79 Date: Mon, 4 Dec 2023 16:31:44 +0300 Subject: [PATCH] fix select (#567) Signed-off-by: Fedor Partanskiy --- internal/bft/viewchanger.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/internal/bft/viewchanger.go b/internal/bft/viewchanger.go index 96172260..505c921a 100644 --- a/internal/bft/viewchanger.go +++ b/internal/bft/viewchanger.go @@ -1320,7 +1320,13 @@ func (v *ViewChanger) Decide(proposal types.Proposal, signatures []types.Signatu } } v.Pruner.MaybePruneRevokedRequests() - v.inFlightDecideChan <- struct{}{} + + select { + case v.inFlightDecideChan <- struct{}{}: + return + case <-v.stopChan: + return + } } // Complain panics when a view change is requested