Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-bitswap
Commits
c783e018
Commit
c783e018
authored
Jun 11, 2019
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(session): obey delay function when searching for more providers
parent
86089ee1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
session/session.go
session/session.go
+2
-2
No files found.
session/session.go
View file @
c783e018
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment