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

Method WaitForPeersStart

p2pserver/p2pserver.go:276–286  ·  view source on GitHub ↗

WaitForPeersStart check whether enough peer linked in loop

()

Source from the content-addressed store, hash-verified

274
275//WaitForPeersStart check whether enough peer linked in loop
276func (this *P2PServer) WaitForPeersStart() {
277 periodTime := config.DEFAULT_GEN_BLOCK_TIME / common.UPDATE_RATE_PER_BLOCK
278 for {
279 log.Info("[p2p]Wait for minimum connection...")
280 if this.reachMinConnection() {
281 break
282 }
283
284 <-time.After(time.Second * (time.Duration(periodTime)))
285 }
286}
287
288//connectSeeds connect the seeds in seedlist and call for nbr list
289func (this *P2PServer) connectSeeds() {

Callers 1

initP2PNodeFunction · 0.80

Calls 2

reachMinConnectionMethod · 0.95
InfoFunction · 0.92

Tested by

no test coverage detected