Skip to content

Commit

Permalink
Remove deprecated call to rand.Seed
Browse files Browse the repository at this point in the history
  • Loading branch information
KforG committed Mar 1, 2024
1 parent 3c8af4d commit 8d0996f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 4 deletions.
1 change: 0 additions & 1 deletion backend/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ func (m *Backend) InstallMinerBinaries() error {
// Additionally it can be run if the backend returns an error after startup
func (m *Backend) BackendServerSelector() {
// Pick a random backend off the list
rand.Seed(time.Now().UnixNano())
n := rand.Intn(len(networks.Active.BackendServers))

// Run a simple check to see if the backend is up and returned data isn't nonsense
Expand Down
2 changes: 0 additions & 2 deletions backend/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"fmt"
"math/rand"
"strconv"
"time"

"github.com/tidwall/buntdb"
"github.com/vertcoin-project/one-click-miner-vnext/logging"
Expand Down Expand Up @@ -73,7 +72,6 @@ func (m *Backend) GetPool() int {
return 2 // Default P2Pool on testnet
}
// Default to a random pool
rand.Seed(time.Now().UnixNano())
pools := pools.GetPools(m.Address(), m.GetTestnet())
pool := pools[rand.Intn(len(pools))].GetID()
// Save this setting immediately so that we don't get
Expand Down
1 change: 0 additions & 1 deletion ping/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ func selector() {
err = PingNodes(NodeList)
if err != nil {
logging.Warnf("Nodes could not be pinged, selecting random node\n")
rand.Seed(time.Now().Unix())
randInt := rand.Intn(len(NodeList))
Selected = SelectedNode{
P2PoolStratum: NodeList[randInt].Stratum,
Expand Down

0 comments on commit 8d0996f

Please sign in to comment.