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
9f3ffaf6
Commit
9f3ffaf6
authored
Jun 14, 2019
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: rand.Intn(0) panics
parent
480b3f75
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
session/session.go
session/session.go
+3
-0
No files found.
session/session.go
View file @
9f3ffaf6
...
@@ -347,6 +347,9 @@ func (s *Session) handlePeriodicSearch(ctx context.Context) {
...
@@ -347,6 +347,9 @@ func (s *Session) handlePeriodicSearch(ctx context.Context) {
}
}
func
(
s
*
Session
)
randomLiveWant
()
cid
.
Cid
{
func
(
s
*
Session
)
randomLiveWant
()
cid
.
Cid
{
if
len
(
s
.
liveWants
)
==
0
{
return
cid
.
Cid
{}
}
i
:=
rand
.
Intn
(
len
(
s
.
liveWants
))
i
:=
rand
.
Intn
(
len
(
s
.
liveWants
))
// picking a random live want
// picking a random live want
for
k
:=
range
s
.
liveWants
{
for
k
:=
range
s
.
liveWants
{
...
...
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