Browse Source

updated dialing logs

pull/39/head
Jae Kwon 10 years ago
parent
commit
29cff9ff48
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      p2p/switch.go

+ 4
- 1
p2p/switch.go View File

@ -137,17 +137,20 @@ func (sw *Switch) DialPeerWithAddress(addr *NetAddress) (*Peer, error) {
return nil, ErrSwitchStopped return nil, ErrSwitchStopped
} }
log.Info("Dialing peer", "address", addr)
log.Debug("Dialing address", "address", addr)
sw.dialing.Set(addr.String(), addr) sw.dialing.Set(addr.String(), addr)
conn, err := addr.DialTimeout(peerDialTimeoutSeconds * time.Second) conn, err := addr.DialTimeout(peerDialTimeoutSeconds * time.Second)
sw.dialing.Delete(addr.String()) sw.dialing.Delete(addr.String())
if err != nil { if err != nil {
log.Debug("Failed dialing address", "address", addr, "error", err)
return nil, err return nil, err
} }
peer, err := sw.AddPeerWithConnection(conn, true) peer, err := sw.AddPeerWithConnection(conn, true)
if err != nil { if err != nil {
log.Debug("Failed adding peer", "address", addr, "conn", conn, "error", err)
return nil, err return nil, err
} }
log.Info("Dialed and added peer", "address", addr, "peer", peer)
return peer, nil return peer, nil
} }


Loading…
Cancel
Save