p2p/discv5, p2p/testing: add missing Timer.Stop calls in tests (#20869)

This commit is contained in:
ucwong
2020-04-02 22:03:40 +08:00
committed by GitHub
parent 37d6357806
commit 0c359e4b9a
2 changed files with 3 additions and 1 deletions

View File

@@ -242,6 +242,7 @@ func (s *ProtocolSession) testExchange(e Exchange) error {
t = 2000 * time.Millisecond
}
alarm := time.NewTimer(t)
defer alarm.Stop()
select {
case err := <-errc:
return err