mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
parent
d976cc65d2
commit
d3b35cba42
1 changed files with 1 additions and 1 deletions
|
|
@ -971,7 +971,7 @@ func (l *flakeyListener) Accept() (net.Conn, error) {
|
|||
|
||||
c, err := l.Listener.Accept()
|
||||
if err == nil {
|
||||
timeout := time.Duration(rand.Int63n(int64(l.maxKillTimeout)))
|
||||
timeout := max(time.Millisecond*10, time.Duration(rand.Int63n(int64(l.maxKillTimeout))))
|
||||
time.AfterFunc(timeout, func() {
|
||||
log.Debug(fmt.Sprintf("killing conn %v after %v", c.LocalAddr(), timeout))
|
||||
c.Close()
|
||||
|
|
|
|||
Loading…
Reference in a new issue