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

Method getNeighbours

consensus/vbft/peer_pool.go:208–219  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

206}
207
208func (pool *PeerPool) getNeighbours() []*Peer {
209 pool.lock.RLock()
210 defer pool.lock.RUnlock()
211
212 peers := make([]*Peer, 0)
213 for _, p := range pool.peers {
214 if p.connected {
215 peers = append(peers, p)
216 }
217 }
218 return peers
219}
220
221func (pool *PeerPool) GetPeerIndex(nodeId string) (uint32, bool) {
222 pool.lock.RLock()

Callers 1

TestGetNeighboursFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestGetNeighboursFunction · 0.64