Fix bug where the defensive copy loses the computed leaf paths
Some checks failed
Test / Run integration tests (push) Failing after 18s
Test / Run unit tests (push) Failing after 21s

https://github.com/cerc-io/go-ethereum/pull/400
This commit is contained in:
Thomas E Lackey 2023-07-23 01:33:58 +08:00 committed by Roy Crihfield
parent b21ca5da75
commit 840d4a4e5d

View File

@ -90,9 +90,11 @@ 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()
p.RUnlock()
return p.Params.Copy() copy.ComputeWatchedAddressesLeafPaths()
return copy
} }
// Args bundles the arguments for the state diff builder // Args bundles the arguments for the state diff builder