From 2e08dad9e6b3b0f675d144cd41cbbef43439a8b7 Mon Sep 17 00:00:00 2001 From: libotony Date: Mon, 13 Jul 2020 17:20:47 +0800 Subject: [PATCH] p2p/discv5: unset pingEcho on pong timeout (#21324) --- p2p/discv5/net.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/p2p/discv5/net.go b/p2p/discv5/net.go index c912cba7d1..53e00a3881 100644 --- a/p2p/discv5/net.go +++ b/p2p/discv5/net.go @@ -1037,6 +1037,9 @@ func (net *Network) handle(n *Node, ev nodeEvent, pkt *ingressPacket) error { net.db.ensureExpirer() } } + if ev == pongTimeout { + n.pingEcho = nil // clean up if pongtimeout + } if n.state == nil { n.state = unknown //??? }