htlcswitch: close the updateFeeTimer properly

This commit is contained in:
yyforyongyu
2020-12-02 06:20:31 +08:00
parent be626df689
commit bf036f2665

View File

@ -516,7 +516,14 @@ func (l *channelLink) Stop() {
l.cfg.ChainEvents.Cancel()
}
l.updateFeeTimer.Stop()
// Ensure the channel for the timer is drained.
if !l.updateFeeTimer.Stop() {
select {
case <-l.updateFeeTimer.C:
default:
}
}
l.hodlQueue.Stop()
close(l.quit)