MCPcopy Create free account
hub / github.com/DNAProject/DNA / getNextNodeId

Function getNextNodeId

p2pserver/block_sync.go:995–1006  ·  view source on GitHub ↗

Using polling for load balance

(nextNodeIndex int, nodeList []uint64)

Source from the content-addressed store, hash-verified

993
994//Using polling for load balance
995func getNextNodeId(nextNodeIndex int, nodeList []uint64) (int, uint64) {
996 num := len(nodeList)
997 if num == 0 {
998 return 0, 0
999 }
1000 if nextNodeIndex >= num {
1001 nextNodeIndex = 0
1002 }
1003 index := nextNodeIndex
1004 nextNodeIndex++
1005 return nextNodeIndex, nodeList[index]
1006}

Callers 1

getNextNodeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected