Explorar el Código

whisper/whisperv6: fix peer time.Ticker leak (#20520)

wangxiang hace 5 años
padre
commit
a013f02df2
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      whisper/whisperv6/peer.go

+ 2 - 0
whisper/whisperv6/peer.go

@@ -146,7 +146,9 @@ func (peer *Peer) handshake() error {
 func (peer *Peer) update() {
 	// Start the tickers for the updates
 	expire := time.NewTicker(expirationCycle)
+	defer expire.Stop()
 	transmit := time.NewTicker(transmissionCycle)
+	defer transmit.Stop()
 
 	// Loop and transmit until termination is requested
 	for {