Fix bug where the defensive copy loses the computed leaf paths. (#401)

This commit is contained in:
Thomas E Lackey 2023-07-21 18:46:18 -05:00 committed by GitHub
parent c72b45fab4
commit 84cb3b705e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,9 +88,9 @@ type ParamsWithMutex struct {
// CopyParams returns a defensive copy of the Params // CopyParams returns a defensive copy of the Params
func (p *ParamsWithMutex) CopyParams() Params { func (p *ParamsWithMutex) CopyParams() Params {
p.RLock() p.RLock()
defer p.RUnlock()
copy := p.Params.Copy() copy := p.Params.Copy()
p.RUnlock()
copy.ComputeWatchedAddressesLeafPaths() copy.ComputeWatchedAddressesLeafPaths()
return copy return copy
} }