aboutsummaryrefslogtreecommitdiffstats
path: root/core/agreement-mgr.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/agreement-mgr.go')
-rw-r--r--core/agreement-mgr.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/agreement-mgr.go b/core/agreement-mgr.go
index 0e39fa5..14aa385 100644
--- a/core/agreement-mgr.go
+++ b/core/agreement-mgr.go
@@ -432,6 +432,13 @@ func (mgr *agreementMgr) baRoutineForOneRound(
var nextHeight uint64
var nextTime time.Time
for {
+ // Make sure we are stoppable.
+ select {
+ case <-mgr.ctx.Done():
+ breakLoop = true
+ return
+ default:
+ }
nextHeight, nextTime = mgr.bcModule.nextBlock()
if isStop(oldPos) && nextHeight == 0 {
break