提交 adcf0bfe 作者: Juan Batiz-Benet

better logging for ping

上级 676d9c5c
......@@ -335,10 +335,11 @@ func (dht *IpfsDHT) findPeerMultiple(ctx context.Context, id peer.ID) (*peer.Pee
// Ping a peer, log the time it took
func (dht *IpfsDHT) Ping(ctx context.Context, p *peer.Peer) error {
// Thoughts: maybe this should accept an ID and do a peer lookup?
u.DOut("Enter Ping.\n")
u.DOut("[%s] ping %s start\n", dht.self.ID.Pretty(), p.ID.Pretty())
pmes := newMessage(Message_PING, "", 0)
_, err := dht.sendRequest(ctx, p, pmes)
u.DOut("[%s] ping %s end (err = %s)\n", dht.self.ID.Pretty(), p.ID.Pretty(), err)
return err
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论