Skip to content

Commit

Permalink
incorporate pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis-tra committed Oct 29, 2022
1 parent eb1e504 commit 92a0d7d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions p2p/host/routed/routed.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ func (rh *RoutedHost) Connect(ctx context.Context, pi peer.AddrInfo) error {
// up-to-date addresses for the given peer. If there
// are addresses we didn't know about previously, we
// try to connect again.
newAddrs, addrErr := rh.findPeerAddrs(ctx, pi.ID)
if addrErr != nil {
return err // return outer error
newAddrs, err := rh.findPeerAddrs(ctx, pi.ID)
if err != nil {
return fmt.Errorf("failed to find peers: %w", err)
}

// Build lookup map
Expand Down
4 changes: 2 additions & 2 deletions p2p/host/routed/routed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ type mockRouting struct {
}

func (m *mockRouting) FindPeer(ctx context.Context, pid peer.ID) (peer.AddrInfo, error) {
m.callCount += 1
m.callCount++
return m.findPeerFn(ctx, pid)
}

func TestRoutedHost_Connect_obsoleteAddresses(t *testing.T) {
func TestRoutedHostConnectToObsoleteAddresses(t *testing.T) {
ctx := context.Background()

h1, err := basic.NewHost(swarmt.GenSwarm(t), nil)
Expand Down

0 comments on commit 92a0d7d

Please sign in to comment.