Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkAfCod committed Jan 16, 2025
1 parent 338ef78 commit 127aaa1
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions portalwire/portal_protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -1196,18 +1196,14 @@ func (p *PortalProtocol) handleOffer(id enode.ID, addr *net.UDPAddr, request *Of

go func(bctx context.Context, connId *zenutp.ConnectionId) {
var conn *zenutp.UtpStream
var connectCtx context.Context
var cancel context.CancelFunc
defer func() {
cancel()
}()
for {
select {
case <-bctx.Done():
return
default:
p.Log.Debug("will accept offer conn from: ", "source", addr, "connId", connId)
connectCtx, cancel = context.WithTimeout(bctx, defaultUTPConnectTimeout)
connectCtx, cancel := context.WithTimeout(bctx, defaultUTPConnectTimeout)
defer cancel()
conn, err = p.Utp.AcceptWithCid(connectCtx, connectionId)
if err != nil {
if metrics.Enabled() {
Expand Down Expand Up @@ -1238,7 +1234,6 @@ func (p *PortalProtocol) handleOffer(id enode.ID, addr *net.UDPAddr, request *Of
if metrics.Enabled() {
p.portalMetrics.utpInSuccess.Inc(1)
}
return
}
}
}(p.closeCtx, connectionId)
Expand Down

0 comments on commit 127aaa1

Please sign in to comment.