Commit c783e018 authored by Steven Allen's avatar Steven Allen

fix(session): obey delay function when searching for more providers

parent 86089ee1
......@@ -240,7 +240,7 @@ func (s *Session) SetBaseTickDelay(baseTickDelay time.Duration) {
// of this loop
func (s *Session) run(ctx context.Context) {
s.tick = time.NewTimer(s.provSearchDelay)
s.rebroadcast = time.NewTimer(s.rebroadcastDelay.Get())
s.rebroadcast = time.NewTimer(s.rebroadcastDelay.NextWaitTime())
for {
select {
case blk := <-s.incoming:
......@@ -342,7 +342,7 @@ func (s *Session) handleRebroadcast(ctx context.Context) {
// for new providers for blocks.
s.pm.FindMorePeers(ctx, s.randomLiveWant())
s.rebroadcast.Reset(s.rebroadcastDelay.Get())
s.rebroadcast.Reset(s.rebroadcastDelay.NextWaitTime())
}
func (s *Session) randomLiveWant() cid.Cid {
......
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