diff options
author | Felföldi Zsolt <zsfelfoldi@gmail.com> | 2018-01-31 00:01:22 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-01-31 00:01:22 +0800 |
commit | 6198c53e28200b3a575f4545cbfa83c585e44b76 (patch) | |
tree | 63c1ab139ea27b6c58c2e172918c1b3f13832764 | |
parent | a9e4a90d57d3c072fb727ee62b71002325e23934 (diff) | |
download | dexon-6198c53e28200b3a575f4545cbfa83c585e44b76.tar dexon-6198c53e28200b3a575f4545cbfa83c585e44b76.tar.gz dexon-6198c53e28200b3a575f4545cbfa83c585e44b76.tar.bz2 dexon-6198c53e28200b3a575f4545cbfa83c585e44b76.tar.lz dexon-6198c53e28200b3a575f4545cbfa83c585e44b76.tar.xz dexon-6198c53e28200b3a575f4545cbfa83c585e44b76.tar.zst dexon-6198c53e28200b3a575f4545cbfa83c585e44b76.zip |
p2p/discv5: fix removeTicketRef cached ticket removal (#15995)
-rw-r--r-- | p2p/discv5/ticket.go | 8 |
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 { |