rename autorelay.WithNumCandidates to WithMaxCandidates

This commit is contained in:
Marten Seemann 2022-04-05 14:19:19 +01:00
parent 7e767cbc22
commit 98f46f2e84
2 changed files with 4 additions and 4 deletions

View File

@ -109,7 +109,7 @@ func TestSingleRelay(t *testing.T) {
}()
h := newPrivateNode(t,
autorelay.WithPeerSource(peerChan),
autorelay.WithNumCandidates(1),
autorelay.WithMaxCandidates(1),
autorelay.WithNumRelays(99999),
autorelay.WithBootDelay(0),
)

View File

@ -13,7 +13,7 @@ type config struct {
staticRelays []peer.AddrInfo
// see WithMinCandidates
minCandidates int
// see WithNumCandidates
// see WithMaxCandidates
maxCandidates int
// Delay until we obtain reservations with relays, if we have less than minCandidates candidates.
// See WithBootDelay.
@ -88,8 +88,8 @@ func WithNumRelays(n int) Option {
}
}
// WithNumCandidates sets the number of relay candidates that we buffer.
func WithNumCandidates(n int) Option {
// WithMaxCandidates sets the number of relay candidates that we buffer.
func WithMaxCandidates(n int) Option {
return func(c *config) error {
c.maxCandidates = n
return nil