This commit is contained in:
Sergey Cherepanov 2023-02-02 21:16:59 +03:00
parent d2a19d21fe
commit 75c660916d
No known key found for this signature in database
GPG Key ID: 87F8EDE8FBDF637C

View File

@ -48,10 +48,7 @@ func (t *TestPool) Get(ctx context.Context, id string) (peer.Peer, error) {
func (t *TestPool) Dial(ctx context.Context, id string) (peer.Peer, error) { func (t *TestPool) Dial(ctx context.Context, id string) (peer.Peer, error) {
t.mu.Lock() t.mu.Lock()
defer t.mu.Unlock() defer t.mu.Unlock()
if t.ts == nil { return t.Get(ctx, id)
return nil, ErrCantConnect
}
return &testPeer{id: id, Conn: t.ts.Dial(ctx)}, nil
} }
func (t *TestPool) GetOneOf(ctx context.Context, peerIds []string) (peer.Peer, error) { func (t *TestPool) GetOneOf(ctx context.Context, peerIds []string) (peer.Peer, error) {