From 7dc0404306c07e8c0e00af58ddaeff164900b567 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 6 May 2022 10:20:55 +0300 Subject: [PATCH] transaction: fix maxSubitems handling in JSON scope unmarshaller Notice that binary deserializer (readArrayOfConditions) does it correctly. Can be checked with neo-project/neo#2720 case. --- pkg/core/transaction/witness_condition.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/core/transaction/witness_condition.go b/pkg/core/transaction/witness_condition.go index cb41b7746..80d01d369 100644 --- a/pkg/core/transaction/witness_condition.go +++ b/pkg/core/transaction/witness_condition.go @@ -491,7 +491,7 @@ func unmarshalArrayOfConditionJSONs(arr []json.RawMessage, maxDepth int) ([]Witn if l == 0 { return nil, errors.New("empty array of conditions") } - if l >= maxSubitems { + if l > maxSubitems { return nil, errors.New("too many elements") } res := make([]WitnessCondition, l)