p2p: use correct context error (#8916)

handshakeCtx is the internal context carrying the timeout. Its error should be used for the error return.
This commit is contained in:
William Banfield
2022-06-30 22:02:59 +00:00
committed by GitHub
parent 5274f80de4
commit 921530c352
+1 -1
View File
@@ -315,7 +315,7 @@ func (c *mConnConnection) Handshake(
select {
case <-handshakeCtx.Done():
_ = c.Close()
return types.NodeInfo{}, nil, ctx.Err()
return types.NodeInfo{}, nil, handshakeCtx.Err()
case err := <-errCh:
if err != nil {