From 92f1e8b71d1cac80fcf197a186168dc8eda1e019 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 28 Jan 2023 13:21:06 +0100 Subject: [PATCH] packages/hyprspace: PeXService: immediately connect to discovered peers --- packages/networking/hyprspace/p2p/pex.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/networking/hyprspace/p2p/pex.go b/packages/networking/hyprspace/p2p/pex.go index 67c9b40..c13b340 100644 --- a/packages/networking/hyprspace/p2p/pex.go +++ b/packages/networking/hyprspace/p2p/pex.go @@ -128,6 +128,7 @@ func PeXService(ctx context.Context, host host.Host, cfg *config.Config) { if err != nil { for _, addrInfo := range addrInfos { host.Peerstore().AddAddrs(addrInfo.ID, addrInfo.Addrs, 30*time.Second) + go host.Connect(ctx, addrInfo) } } }() @@ -141,6 +142,7 @@ func PeXService(ctx context.Context, host host.Host, cfg *config.Config) { if err != nil { for _, addrInfo := range addrInfos { host.Peerstore().AddAddrs(addrInfo.ID, addrInfo.Addrs, 30*time.Second) + go host.Connect(ctx, addrInfo) } } }()