packages/hyprspace: PeXService: immediately connect to discovered peers
This commit is contained in:
parent
e7d7e5e80f
commit
92f1e8b71d
1 changed files with 2 additions and 0 deletions
|
@ -128,6 +128,7 @@ func PeXService(ctx context.Context, host host.Host, cfg *config.Config) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
for _, addrInfo := range addrInfos {
|
for _, addrInfo := range addrInfos {
|
||||||
host.Peerstore().AddAddrs(addrInfo.ID, addrInfo.Addrs, 30*time.Second)
|
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 {
|
if err != nil {
|
||||||
for _, addrInfo := range addrInfos {
|
for _, addrInfo := range addrInfos {
|
||||||
host.Peerstore().AddAddrs(addrInfo.ID, addrInfo.Addrs, 30*time.Second)
|
host.Peerstore().AddAddrs(addrInfo.ID, addrInfo.Addrs, 30*time.Second)
|
||||||
|
go host.Connect(ctx, addrInfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
Loading…
Reference in a new issue