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

Method IsIPInInConnRecord

p2pserver/net/netserver/netserver.go:536–547  ·  view source on GitHub ↗

IsIPInInConnRecord return result whether the IP is in inConnRecordList

(ip string)

Source from the content-addressed store, hash-verified

534
535//IsIPInInConnRecord return result whether the IP is in inConnRecordList
536func (this *NetServer) IsIPInInConnRecord(ip string) bool {
537 this.inConnRecord.RLock()
538 defer this.inConnRecord.RUnlock()
539 var ipRecord string
540 for addr := range this.inConnRecord.InConnectingAddrs {
541 ipRecord, _ = common.ParseIPAddr(addr)
542 if 0 == strings.Compare(ipRecord, ip) {
543 return true
544 }
545 }
546 return false
547}
548
549//RemoveInConnRecord remove in connection from inConnRecordList
550func (this *NetServer) RemoveFromInConnRecord(addr string) {

Callers

nothing calls this directly

Calls 1

ParseIPAddrFunction · 0.92

Tested by

no test coverage detected