Skip to content

Commit

Permalink
cmd/bootnode: fix timer leak (#27754)
Browse files Browse the repository at this point in the history
  • Loading branch information
ucwong authored Aug 1, 2023
1 parent f404a2d commit 9d744f0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmd/bootnode/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ func doPortMapping(natm nat.Interface, ln *enode.LocalNode, addr *net.UDPAddr) *
// Refresh the mapping periodically.
go func() {
refresh := time.NewTimer(mapTimeout)
defer refresh.Stop()
for range refresh.C {
addMapping()
refresh.Reset(mapTimeout)
Expand Down

0 comments on commit 9d744f0

Please sign in to comment.