1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-30 01:52:26 +08:00

better logging for ping

This commit is contained in:
Juan Batiz-Benet
2014-09-22 15:53:37 -07:00
parent 676d9c5c96
commit adcf0bfe70

View File

@ -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
}