From 9a043e39a07470b8c412c64a906a6006e9065035 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Thu, 2 Feb 2023 21:16:59 +0300 Subject: [PATCH] fix --- net/rpc/rpctest/pool.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/rpc/rpctest/pool.go b/net/rpc/rpctest/pool.go index 5faedd44..4824d421 100644 --- a/net/rpc/rpctest/pool.go +++ b/net/rpc/rpctest/pool.go @@ -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) { t.mu.Lock() defer t.mu.Unlock() - if t.ts == nil { - return nil, ErrCantConnect - } - return &testPeer{id: id, Conn: t.ts.Dial(ctx)}, nil + return t.Get(ctx, id) } func (t *TestPool) GetOneOf(ctx context.Context, peerIds []string) (peer.Peer, error) {