mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
p2p: revert use of ticker in ping loop
This commit is contained in:
parent
4515cd3b9f
commit
50d37537be
1 changed files with 2 additions and 1 deletions
|
|
@ -297,7 +297,7 @@ loop:
|
|||
func (p *Peer) pingLoop() {
|
||||
defer p.wg.Done()
|
||||
|
||||
ping := time.NewTicker(pingInterval)
|
||||
ping := time.NewTimer(pingInterval)
|
||||
defer ping.Stop()
|
||||
|
||||
for {
|
||||
|
|
@ -307,6 +307,7 @@ func (p *Peer) pingLoop() {
|
|||
p.protoErr <- err
|
||||
return
|
||||
}
|
||||
ping.Reset(pingInterval)
|
||||
|
||||
case <-p.pingRecv:
|
||||
SendItems(p.rw, pongMsg)
|
||||
|
|
|
|||
Loading…
Reference in a new issue