Commit 256e680c authored by hannahhoward's avatar hannahhoward

fix(messagequeue): add nil check

Make sure rebroadcast timer doesn't get reset if it's nil
parent 076f7091
......@@ -79,7 +79,9 @@ func (mq *MessageQueue) AddWantlist(initialWants *wantlist.SessionTrackedWantlis
func (mq *MessageQueue) SetRebroadcastInterval(delay time.Duration) {
mq.rebroadcastIntervalLk.Lock()
mq.rebroadcastInterval = delay
mq.rebroadcastTimer.Reset(delay)
if mq.rebroadcastTimer != nil {
mq.rebroadcastTimer.Reset(delay)
}
mq.rebroadcastIntervalLk.Unlock()
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment