diff --git a/core/commands/ping.go b/core/commands/ping.go index 0943ffdcd..c3209f23f 100644 --- a/core/commands/ping.go +++ b/core/commands/ping.go @@ -110,6 +110,7 @@ send pings, wait for pongs, and print out round-trip latency information. } ctx, _ := context.WithTimeout(context.Background(), kPingTimeout) p, err := n.Routing.FindPeer(ctx, peerID) + n.Peerstore.AddPeerInfo(p) if err != nil { outChan <- &PingResult{Text: "Peer lookup error!"} outChan <- &PingResult{Text: err.Error()} diff --git a/routing/dht/dht_test.go b/routing/dht/dht_test.go index 4d63c0e44..818fd5911 100644 --- a/routing/dht/dht_test.go +++ b/routing/dht/dht_test.go @@ -116,12 +116,12 @@ func TestPing(t *testing.T) { //Test that we can ping the node ctxT, _ := context.WithTimeout(ctx, 100*time.Millisecond) - if err := dhtA.Ping(ctxT, peerB); err != nil { + if _, err := dhtA.Ping(ctxT, peerB); err != nil { t.Fatal(err) } ctxT, _ = context.WithTimeout(ctx, 100*time.Millisecond) - if err := dhtB.Ping(ctxT, peerA); err != nil { + if _, err := dhtB.Ping(ctxT, peerA); err != nil { t.Fatal(err) } }