Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion comm/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (ps *PeerSet) Slice() Peers {
defer ps.lock.Unlock()

ret := make(Peers, len(ps.m))
perm := rand.Perm(len(ps.m))
perm := rand.Perm(len(ps.m)) //#nosec G404 -- non-crypto shuffle for peer ordering
i := 0
for _, s := range ps.m {
// randomly
Expand Down
2 changes: 1 addition & 1 deletion p2p/discv5/ticket.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ func (s *ticketStore) addTicket(localTime mclock.AbsTime, pingHash []byte, ticke

if _, ok := s.tickets[topic]; ok {
wait := ticket.regTime[topicIdx] - localTime
rnd := rand.ExpFloat64()
rnd := rand.ExpFloat64() //#nosec G404 -- non-crypto jitter for ticket registration wait
rnd = min(rnd, 10)
if float64(wait) < float64(keepTicketConst)+float64(keepTicketExp)*rnd {
// use the ticket to register this topic
Expand Down
2 changes: 1 addition & 1 deletion p2p/discv5/topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ func (w *waitControlLoop) hasMinimumWaitPeriod() bool {
}

func noRegTimeout() time.Duration {
e := rand.ExpFloat64()
e := rand.ExpFloat64() //#nosec G404 -- non-crypto jitter for registration timeout
e = min(e, 100)
return time.Duration(float64(avgnoRegTimeout) * e)
}
Expand Down
Loading