Skip to content

Commit

Permalink
fix leak in startConsensus
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrajovic committed Sep 7, 2022
1 parent 8e9099a commit 68df30d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion consensus/ibft/ibft.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,10 @@ func (i *backendIBFT) startConsensus() {
// to insert a valid block. Used for cancelling active consensus
// rounds for a specific height
go func() {
eventCh := newBlockSub.GetEventCh()

for {
if ev := <-newBlockSub.GetEventCh(); ev.Source == "syncer" {
if ev := <-eventCh; ev.Source == "syncer" {
if ev.NewChain[0].Number < i.blockchain.Header().Number {
// The blockchain notification system can eventually deliver
// stale block notifications. These should be ignored
Expand Down

0 comments on commit 68df30d

Please sign in to comment.