forked from cerc-io/plugeth
cmd/bootnode: fix timer leak (#27754)
This commit is contained in:
parent
f404a2d0f1
commit
9d744f0ca8
@ -197,6 +197,7 @@ func doPortMapping(natm nat.Interface, ln *enode.LocalNode, addr *net.UDPAddr) *
|
|||||||
// Refresh the mapping periodically.
|
// Refresh the mapping periodically.
|
||||||
go func() {
|
go func() {
|
||||||
refresh := time.NewTimer(mapTimeout)
|
refresh := time.NewTimer(mapTimeout)
|
||||||
|
defer refresh.Stop()
|
||||||
for range refresh.C {
|
for range refresh.C {
|
||||||
addMapping()
|
addMapping()
|
||||||
refresh.Reset(mapTimeout)
|
refresh.Reset(mapTimeout)
|
||||||
|
Loading…
Reference in New Issue
Block a user