aboutsummaryrefslogtreecommitdiffstats
path: root/peer.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-06-14 17:46:09 +0800
committerobscuren <geffobscura@gmail.com>2014-06-14 17:46:09 +0800
commit63883bf27d8b87f601e1603e9024a279b91bffb7 (patch)
treebe430bdebb7c73f761e9cded3f3600820dd8763c /peer.go
parent81245473486dd680b7121d4b227ca8a57d07b4b1 (diff)
downloadgo-tangerine-63883bf27d8b87f601e1603e9024a279b91bffb7.tar.gz
go-tangerine-63883bf27d8b87f601e1603e9024a279b91bffb7.tar.zst
go-tangerine-63883bf27d8b87f601e1603e9024a279b91bffb7.zip
Moving closer to interop
Diffstat (limited to 'peer.go')
-rw-r--r--peer.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/peer.go b/peer.go
index 4434715fb..9da2ed002 100644
--- a/peer.go
+++ b/peer.go
@@ -19,7 +19,7 @@ const (
// Current protocol version
ProtocolVersion = 20
// Interval for ping/pong message
- pingPongTimer = 30 * time.Second
+ pingPongTimer = 1 * time.Second
)
type DiscReason byte
@@ -270,7 +270,7 @@ out:
// Ping timer
case <-pingTimer.C:
timeSince := time.Since(time.Unix(p.lastPong, 0))
- if p.pingStartTime.IsZero() == false && timeSince > (pingPongTimer+10*time.Second) {
+ if !p.pingStartTime.IsZero() && p.lastPong != 0 && timeSince > (pingPongTimer+10*time.Second) {
ethutil.Config.Log.Infof("[PEER] Peer did not respond to latest pong fast enough, it took %s, disconnecting.\n", timeSince)
p.Stop()
return