Skip to content

Commit

Permalink
identify: refactor sending of Identify pushes
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Jan 12, 2023
1 parent 6bcab9e commit f5fa030
Show file tree
Hide file tree
Showing 9 changed files with 252 additions and 402 deletions.
2 changes: 2 additions & 0 deletions p2p/host/basic/basic_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ func NewHost(n network.Network, opts *HostOpts) (*BasicHost, error) {
ListenCloseF: listenHandler,
})

h.ids.Start()

return h, nil
}

Expand Down
2 changes: 1 addition & 1 deletion p2p/net/mock/mock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ func TestLimitedStreams(t *testing.T) {
}

wg.Wait()
if !within(time.Since(before), time.Second*2, time.Second) {
if !within(time.Since(before), time.Second*3, time.Second) {
t.Fatal("Expected 2ish seconds but got ", time.Since(before))
}
}
Expand Down
2 changes: 2 additions & 0 deletions p2p/protocol/holepunch/holepunch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ var _ identify.IDService = &mockIDService{}
func newMockIDService(t *testing.T, h host.Host) identify.IDService {
ids, err := identify.NewIDService(h)
require.NoError(t, err)
ids.Start()
t.Cleanup(func() { ids.Close() })
return &mockIDService{IDService: ids}
}

Expand Down
Loading

0 comments on commit f5fa030

Please sign in to comment.