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 eff509d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion p2p/host/routed/routed.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (rh *RoutedHost) Connect(ctx context.Context, pi peer.AddrInfo) error {
// try to connect again.
newAddrs, addrErr := rh.findPeerAddrs(ctx, pi.ID)
if addrErr != nil {
return err // return outer error
return fmt.Errorf("%s: %s", err, addrErr)
}

// 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 eff509d

Please sign in to comment.