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

Method isNewPeer

consensus/vbft/peer_pool.go:78–87  ·  view source on GitHub ↗

FIXME: should rename to isPeerConnected

(peerIdx uint32)

Source from the content-addressed store, hash-verified

76
77// FIXME: should rename to isPeerConnected
78func (pool *PeerPool) isNewPeer(peerIdx uint32) bool {
79 pool.lock.RLock()
80 defer pool.lock.RUnlock()
81
82 if _, present := pool.peers[peerIdx]; present {
83 return !pool.peers[peerIdx].connected
84 }
85
86 return true
87}
88
89func (pool *PeerPool) addPeer(config *vconfig.PeerConfig) error {
90 pool.lock.Lock()

Callers 3

waitPeerConnectedMethod · 0.95
NewConsensusPayloadMethod · 0.80
TestIsNewPeerFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestIsNewPeerFunction · 0.64