提交 3ed9b0c4 作者: Brian Tiger Chow

log(dht) Event: connect

License: MIT
Signed-off-by: 's avatarBrian Tiger Chow <brian@perfmode.com>
上级 f3b71cfb
......@@ -98,8 +98,6 @@ func NewDHT(ctx context.Context, p peer.Peer, ps peer.Peerstore, dialer inet.Dia
// Connect to a new peer at the given address, ping and add to the routing table
func (dht *IpfsDHT) Connect(ctx context.Context, npeer peer.Peer) (peer.Peer, error) {
log.Debugf("Connect to new peer: %s", npeer)
// TODO(jbenet,whyrusleeping)
//
// Connect should take in a Peer (with ID). In a sense, we shouldn't be
......@@ -120,6 +118,7 @@ func (dht *IpfsDHT) Connect(ctx context.Context, npeer peer.Peer) (peer.Peer, er
if err != nil {
return nil, fmt.Errorf("failed to ping newly connected peer: %s\n", err)
}
log.Event(ctx, "connect", dht.self, npeer)
dht.Update(ctx, npeer)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论