packages/hyprspace: imagine
This commit is contained in:
parent
33782687e9
commit
16384da670
1 changed files with 2 additions and 2 deletions
|
@ -129,7 +129,7 @@ func PeXService(ctx context.Context, host host.Host, cfg *config.Config) {
|
||||||
if evt.Connectedness == network.Connected {
|
if evt.Connectedness == network.Connected {
|
||||||
go func() {
|
go func() {
|
||||||
addrInfos, err := RequestPeX(ctx, host, []peer.ID{evt.Peer})
|
addrInfos, err := RequestPeX(ctx, host, []peer.ID{evt.Peer})
|
||||||
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)
|
go host.Connect(ctx, addrInfo)
|
||||||
|
@ -143,7 +143,7 @@ func PeXService(ctx context.Context, host host.Host, cfg *config.Config) {
|
||||||
}
|
}
|
||||||
go func() {
|
go func() {
|
||||||
addrInfos, err := RequestPeX(ctx, host, peers)
|
addrInfos, err := RequestPeX(ctx, host, peers)
|
||||||
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)
|
go host.Connect(ctx, addrInfo)
|
||||||
|
|
Loading…
Reference in a new issue