Skip to content

Commit

Permalink
kill math/rand
Browse files Browse the repository at this point in the history
  • Loading branch information
jrick committed Jun 12, 2024
1 parent 5bba392 commit 1fdf14a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions peer/peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"fmt"
"hash"
"io"
"math/rand"
"net"
"runtime/debug"
"strconv"
Expand Down Expand Up @@ -846,7 +845,7 @@ func (p *Peer) PushAddrMsg(addresses []*wire.NetAddress) ([]*wire.NetAddress, er
if len(msg.AddrList) > wire.MaxAddrPerMsg {
// Shuffle the address list.
for i := range msg.AddrList {
j := rand.Intn(i + 1)
j := uniform.Int64n(int64(i) + 1)
msg.AddrList[i], msg.AddrList[j] = msg.AddrList[j], msg.AddrList[i]
}

Expand Down Expand Up @@ -2263,7 +2262,3 @@ func NewOutboundPeer(cfg *Config, addr string) (*Peer, error) {

return p, nil
}

func init() {
rand.Seed(time.Now().UnixNano())
}

0 comments on commit 1fdf14a

Please sign in to comment.