Sfoglia il codice sorgente

p2p/discv5: unset pingEcho on pong timeout (#21324)

libotony 5 anni fa
parent
commit
2e08dad9e6
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      p2p/discv5/net.go

+ 3 - 0
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 //???
 	}