consensus: drain messages and transactions on exit as well
There might be some threads blocked on these channels.
This commit is contained in:
parent
cd4f46247d
commit
527505ea5e
1 changed files with 6 additions and 2 deletions
|
@ -332,14 +332,18 @@ events:
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drainBlocksLoop:
|
drainLoop:
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
|
case <-s.messages:
|
||||||
|
case <-s.transactions:
|
||||||
case <-s.blockEvents:
|
case <-s.blockEvents:
|
||||||
default:
|
default:
|
||||||
break drainBlocksLoop
|
break drainLoop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
close(s.messages)
|
||||||
|
close(s.transactions)
|
||||||
close(s.blockEvents)
|
close(s.blockEvents)
|
||||||
close(s.finished)
|
close(s.finished)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue