record the peer which is going to be dialed and sent version message but not in establish state
(addr string)
| 428 | |
| 429 | //record the peer which is going to be dialed and sent version message but not in establish state |
| 430 | func (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 |
| 443 | func (this *NetServer) RemoveFromConnectingList(addr string) { |