htlcswitch: close the updateFeeTimer properly

This commit is contained in:
yyforyongyu 2020-12-02 06:20:31 +08:00
parent be626df689
commit bf036f2665
No known key found for this signature in database
GPG Key ID: 9BCD95C4FF296868

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)