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

Method AddOutConnectingList

p2pserver/net/netserver/netserver.go:430–440  ·  view source on GitHub ↗

record the peer which is going to be dialed and sent version message but not in establish state

(addr string)

Source from the content-addressed store, hash-verified

428
429//record the peer which is going to be dialed and sent version message but not in establish state
430func (this *NetServer) AddOutConnectingList(addr string) (added bool) {
431 this.connectingNodes.Lock()
432 defer this.connectingNodes.Unlock()
433 if this.connectingNodes.ConnectingAddrs.Has(addr) {
434 return false
435 }
436
437 log.Trace("[p2p]add to out connecting list", addr)
438 this.connectingNodes.ConnectingAddrs.Insert(addr)
439 return true
440}
441
442//Remove the peer from connecting list if the connection is established
443func (this *NetServer) RemoveFromConnectingList(addr string) {

Callers 2

ConnectMethod · 0.95
TestConnectingNodeAPIFunction · 0.95

Calls 3

TraceFunction · 0.92
HasMethod · 0.65
InsertMethod · 0.45

Tested by 1

TestConnectingNodeAPIFunction · 0.76