Przeglądaj źródła

p2p/discv5: fix topic register panic at shutdown (#15946)

Felföldi Zsolt 7 lat temu
rodzic
commit
397c6cde1e
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      p2p/discv5/ticket.go

+ 1 - 1
p2p/discv5/ticket.go

@@ -350,7 +350,7 @@ func (s *ticketStore) nextFilteredTicket() (*ticketRef, time.Duration) {
 
 		regTime := now + mclock.AbsTime(wait)
 		topic := ticket.t.topics[ticket.idx]
-		if regTime >= s.tickets[topic].nextReg {
+		if s.tickets[topic] != nil && regTime >= s.tickets[topic].nextReg {
 			return ticket, wait
 		}
 		s.removeTicketRef(*ticket)