From ef08e51e40f5d07aa06f291dabe4cfde9fbf2930 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Date: Wed, 17 Nov 2021 09:21:06 +0100 Subject: [PATCH] merge undefined instead of panicking (#30) --- core/types/access_witness.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/types/access_witness.go b/core/types/access_witness.go index 9ea82045e714..3fe6b78dc555 100644 --- a/core/types/access_witness.go +++ b/core/types/access_witness.go @@ -96,9 +96,10 @@ func (aw *AccessWitness) TouchAddressAndChargeGas(addr, value []byte) uint64 { // of a tx, with the accumulation of witnesses that were generated during the // execution of all the txs preceding this one in a given block. func (aw *AccessWitness) Merge(other *AccessWitness) { - // catch unresolved touched addresses - if len(other.Undefined) != 0 { - panic("undefined value in witness") + for k := range other.Undefined { + if _, ok := aw.Undefined[k]; !ok { + aw.Undefined[k] = struct{}{} + } } for k := range other.Branches {