consensus: drain messages and transactions on exit as well

There might be some threads blocked on these channels.
This commit is contained in:
Roman Khimov 2022-07-01 21:55:41 +03:00
parent cd4f46247d
commit 527505ea5e

View file

@ -332,14 +332,18 @@ events:
default:
}
}
drainBlocksLoop:
drainLoop:
for {
select {
case <-s.messages:
case <-s.transactions:
case <-s.blockEvents:
default:
break drainBlocksLoop
break drainLoop
}
}
close(s.messages)
close(s.transactions)
close(s.blockEvents)
close(s.finished)
}