From 840d4a4e5d42110e694941afa734dac8fea126fe Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Sun, 23 Jul 2023 01:33:58 +0800 Subject: [PATCH] Fix bug where the defensive copy loses the computed leaf paths https://github.com/cerc-io/go-ethereum/pull/400 --- config.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config.go b/config.go index 4f9d704..8f11ece 100644 --- a/config.go +++ b/config.go @@ -90,9 +90,11 @@ type ParamsWithMutex struct { // CopyParams returns a defensive copy of the Params func (p *ParamsWithMutex) CopyParams() Params { 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