aboutsummaryrefslogtreecommitdiffstats
path: root/p2p
diff options
context:
space:
mode:
authorFelföldi Zsolt <zsfelfoldi@gmail.com>2018-01-31 00:01:22 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-01-31 00:01:22 +0800
commit6198c53e28200b3a575f4545cbfa83c585e44b76 (patch)
tree63c1ab139ea27b6c58c2e172918c1b3f13832764 /p2p
parenta9e4a90d57d3c072fb727ee62b71002325e23934 (diff)
downloadgo-tangerine-6198c53e28200b3a575f4545cbfa83c585e44b76.tar
go-tangerine-6198c53e28200b3a575f4545cbfa83c585e44b76.tar.gz
go-tangerine-6198c53e28200b3a575f4545cbfa83c585e44b76.tar.bz2
go-tangerine-6198c53e28200b3a575f4545cbfa83c585e44b76.tar.lz
go-tangerine-6198c53e28200b3a575f4545cbfa83c585e44b76.tar.xz
go-tangerine-6198c53e28200b3a575f4545cbfa83c585e44b76.tar.zst
go-tangerine-6198c53e28200b3a575f4545cbfa83c585e44b76.zip
p2p/discv5: fix removeTicketRef cached ticket removal (#15995)
Diffstat (limited to 'p2p')
-rw-r--r--p2p/discv5/ticket.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/p2p/discv5/ticket.go b/p2p/discv5/ticket.go
index 1ecef37e4..37ce8d23c 100644
--- a/p2p/discv5/ticket.go
+++ b/p2p/discv5/ticket.go
@@ -420,11 +420,14 @@ func (s *ticketStore) nextRegisterableTicket() (*ticketRef, time.Duration) {
func (s *ticketStore) removeTicketRef(ref ticketRef) {
log.Trace("Removing discovery ticket reference", "node", ref.t.node.ID, "serial", ref.t.serial)
+ // Make nextRegisterableTicket return the next available ticket.
+ s.nextTicketCached = nil
+
topic := ref.topic()
tickets := s.tickets[topic]
if tickets == nil {
- log.Warn("Removing tickets from unknown topic", "topic", topic)
+ log.Trace("Removing tickets from unknown topic", "topic", topic)
return
}
bucket := timeBucket(ref.t.regTime[ref.idx] / mclock.AbsTime(ticketTimeBucketLen))
@@ -450,9 +453,6 @@ func (s *ticketStore) removeTicketRef(ref ticketRef) {
delete(s.nodes, ref.t.node)
delete(s.nodeLastReq, ref.t.node)
}
-
- // Make nextRegisterableTicket return the next available ticket.
- s.nextTicketCached = nil
}
type lookupInfo struct {