diff options
author | Felföldi Zsolt <zsfelfoldi@gmail.com> | 2018-02-09 01:06:31 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-02-09 01:06:31 +0800 |
commit | c4712bf96bc1bae4a5ad4600e9719e4a74bde7d5 (patch) | |
tree | 9b1faeb171246e07d9b43c97671e1b5f94510740 /p2p/discv5/ticket.go | |
parent | 2b4c7e9b37958984525ba63f2ec637662b384090 (diff) | |
download | dexon-c4712bf96bc1bae4a5ad4600e9719e4a74bde7d5.tar dexon-c4712bf96bc1bae4a5ad4600e9719e4a74bde7d5.tar.gz dexon-c4712bf96bc1bae4a5ad4600e9719e4a74bde7d5.tar.bz2 dexon-c4712bf96bc1bae4a5ad4600e9719e4a74bde7d5.tar.lz dexon-c4712bf96bc1bae4a5ad4600e9719e4a74bde7d5.tar.xz dexon-c4712bf96bc1bae4a5ad4600e9719e4a74bde7d5.tar.zst dexon-c4712bf96bc1bae4a5ad4600e9719e4a74bde7d5.zip |
p2p/discv5: fix multiple discovery issues (#16036)
* p2p/discv5: add query delay, fix node address update logic, retry refresh if empty
* p2p/discv5: remove unnecessary ping before topic query
* p2p/discv5: do not filter local address from topicNodes
* p2p/discv5: remove canQuery()
* p2p/discv5: gofmt
Diffstat (limited to 'p2p/discv5/ticket.go')
-rw-r--r-- | p2p/discv5/ticket.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/p2p/discv5/ticket.go b/p2p/discv5/ticket.go index 37ce8d23c..b3d1ac4ba 100644 --- a/p2p/discv5/ticket.go +++ b/p2p/discv5/ticket.go @@ -494,13 +494,13 @@ func (s *ticketStore) registerLookupDone(lookup lookupInfo, nodes []*Node, ping } } -func (s *ticketStore) searchLookupDone(lookup lookupInfo, nodes []*Node, ping func(n *Node) []byte, query func(n *Node, topic Topic) []byte) { +func (s *ticketStore) searchLookupDone(lookup lookupInfo, nodes []*Node, query func(n *Node, topic Topic) []byte) { now := mclock.Now() for i, n := range nodes { if i == 0 || (binary.BigEndian.Uint64(n.sha[:8])^binary.BigEndian.Uint64(lookup.target[:8])) < s.radius[lookup.topic].minRadius { if lookup.radiusLookup { if lastReq, ok := s.nodeLastReq[n]; !ok || time.Duration(now-lastReq.time) > radiusTC { - s.nodeLastReq[n] = reqInfo{pingHash: ping(n), lookup: lookup, time: now} + s.nodeLastReq[n] = reqInfo{pingHash: nil, lookup: lookup, time: now} } } // else { if s.canQueryTopic(n, lookup.topic) { |