diff --git a/core/state/state_object.go b/core/state/state_object.go index 1ffb7eb40..bc1ca1f40 100644 --- a/core/state/state_object.go +++ b/core/state/state_object.go @@ -49,7 +49,7 @@ func (s Storage) String() (str string) { } func (s Storage) Copy() Storage { - cpy := make(Storage) + cpy := make(Storage, len(s)) for key, value := range s { cpy[key] = value } diff --git a/eth/tracers/logger/logger.go b/eth/tracers/logger/logger.go index bd326daaf..07aa2f2b4 100644 --- a/eth/tracers/logger/logger.go +++ b/eth/tracers/logger/logger.go @@ -40,7 +40,7 @@ type Storage map[common.Hash]common.Hash // Copy duplicates the current storage. func (s Storage) Copy() Storage { - cpy := make(Storage) + cpy := make(Storage, len(s)) for key, value := range s { cpy[key] = value }