addToRetryList add retry address to ReconnectAddrs
(addr string)
| 543 | |
| 544 | //addToRetryList add retry address to ReconnectAddrs |
| 545 | func (this *P2PServer) addToRetryList(addr string) { |
| 546 | this.ReconnectAddrs.Lock() |
| 547 | defer this.ReconnectAddrs.Unlock() |
| 548 | if this.RetryAddrs == nil { |
| 549 | this.RetryAddrs = make(map[string]int) |
| 550 | } |
| 551 | if _, ok := this.RetryAddrs[addr]; ok { |
| 552 | delete(this.RetryAddrs, addr) |
| 553 | } |
| 554 | //alway set retry to 0 |
| 555 | this.RetryAddrs[addr] = 0 |
| 556 | } |
| 557 | |
| 558 | //removeFromRetryList remove connected address from ReconnectAddrs |
| 559 | func (this *P2PServer) removeFromRetryList(addr string) { |