WaitForPeersStart check whether enough peer linked in loop
()
| 274 | |
| 275 | //WaitForPeersStart check whether enough peer linked in loop |
| 276 | func (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 |
| 289 | func (this *P2PServer) connectSeeds() { |
no test coverage detected