aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-11-11 13:28:33 +0800
committerGitHub <noreply@github.com>2016-11-11 13:28:33 +0800
commit932d973e36ff0d41a6005b93d2d4ff1b4430fb04 (patch)
tree7a660e6f3f2b3d628600b825fba4adbe64d70718
parent9eb6f627fa9e08573580fc5915e23d332a36071b (diff)
parent323c2d6775c86c063e9048ef0e8605283f07cafb (diff)
downloadgo-tangerine-932d973e36ff0d41a6005b93d2d4ff1b4430fb04.tar
go-tangerine-932d973e36ff0d41a6005b93d2d4ff1b4430fb04.tar.gz
go-tangerine-932d973e36ff0d41a6005b93d2d4ff1b4430fb04.tar.bz2
go-tangerine-932d973e36ff0d41a6005b93d2d4ff1b4430fb04.tar.lz
go-tangerine-932d973e36ff0d41a6005b93d2d4ff1b4430fb04.tar.xz
go-tangerine-932d973e36ff0d41a6005b93d2d4ff1b4430fb04.tar.zst
go-tangerine-932d973e36ff0d41a6005b93d2d4ff1b4430fb04.zip
Merge pull request #3248 from zsfelfoldi/light-topic3
Topic discovery bugfix
-rw-r--r--les/handler.go7
-rw-r--r--p2p/discv5/net.go3
2 files changed, 8 insertions, 2 deletions
diff --git a/les/handler.go b/les/handler.go
index 44a0a1661..cf698d79c 100644
--- a/les/handler.go
+++ b/les/handler.go
@@ -236,7 +236,7 @@ func (pm *ProtocolManager) removePeer(id string) {
}
func (pm *ProtocolManager) findServers() {
- if pm.p2pServer == nil {
+ if pm.p2pServer == nil || pm.topicDisc == nil {
return
}
enodes := make(chan string, 100)
@@ -259,7 +259,10 @@ func (pm *ProtocolManager) findServers() {
}
}
}()
- time.Sleep(time.Second * 20)
+ select {
+ case <-time.After(time.Second * 20):
+ case <-pm.quitSync:
+ }
close(stop)
}
diff --git a/p2p/discv5/net.go b/p2p/discv5/net.go
index afc92e99f..b08cd2bc7 100644
--- a/p2p/discv5/net.go
+++ b/p2p/discv5/net.go
@@ -863,6 +863,9 @@ func init() {
name: "verifywait",
handle: func(net *Network, n *Node, ev nodeEvent, pkt *ingressPacket) (*nodeState, error) {
switch ev {
+ case pingPacket:
+ net.handlePing(n, pkt)
+ return verifywait, nil
case pongPacket:
err := net.handleKnownPong(n, pkt)
return known, err