packages/hyprspace: improve logging

This commit is contained in:
Max Headroom 2022-09-26 19:50:36 +02:00
parent 8c2b6341c0
commit cbe51dd88c
2 changed files with 3 additions and 4 deletions

View file

@ -216,10 +216,9 @@ func UpRun(r *cmd.Root, c *cmd.Sub) {
// Check if the destination of the packet is a known peer to
// the interface.
if peer, ok := peerTable[dst]; ok {
fmt.Println("[-] Connecting to peer: " + peer.Pretty())
stream, err = host.NewStream(ctx, peer, p2p.Protocol)
if err != nil {
fmt.Println("[!] Failed to dial peer: " + peer.Pretty())
fmt.Println("[!] Failed to open stream to " + dst)
go p2p.Rediscover(discoverNow)
continue
}

View file

@ -32,11 +32,11 @@ func Discover(ctx context.Context, h host.Host, dht *dht.IpfsDHT, peerTable map[
if err != nil {
continue
}
_, err = h.Network().DialPeer(ctx, addrs.ID)
conn, err := h.Network().DialPeer(ctx, addrs.ID)
if err != nil {
continue
}
fmt.Println("[+] Connected to " + nd)
fmt.Printf("[+] Connected to %s at %s\n", nd, conn.RemoteMultiaddr())
}
}
dur = dur * 2