MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / Find

Method Find

proto/servers.go:61–73  ·  view source on GitHub ↗

Find finds the index of the server with the specified key in the server list.

(key NodeID)

Source from the content-addressed store, hash-verified

59
60// Find finds the index of the server with the specified key in the server list.
61func (p *Peers) Find(key NodeID) (index int32, found bool) {
62 if p.Servers != nil {
63 for i, s := range p.Servers {
64 if key.IsEqual(&s) {
65 index = int32(i)
66 found = true
67 break
68 }
69 }
70 }
71
72 return
73}

Callers 5

TestPeersFunction · 0.95
buildBlockProducerInfosFunction · 0.80
CheckAndPushNewBlockMethod · 0.80
newRunTimeFunction · 0.80
updatePeersMethod · 0.80

Calls 1

IsEqualMethod · 0.45

Tested by 1

TestPeersFunction · 0.76