aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--p2p/peer.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/p2p/peer.go b/p2p/peer.go
index a9c20189a..fb4b39e95 100644
--- a/p2p/peer.go
+++ b/p2p/peer.go
@@ -190,7 +190,7 @@ loop:
}
func (p *Peer) pingLoop() {
- ping := time.NewTicker(pingInterval)
+ ping := time.NewTimer(pingInterval)
defer p.wg.Done()
defer ping.Stop()
for {
@@ -200,6 +200,7 @@ func (p *Peer) pingLoop() {
p.protoErr <- err
return
}
+ ping.Reset(pingInterval)
case <-p.closed:
return
}