From 01082a8988cf049673e1857415f08534e879b512 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 14 Nov 2019 16:09:57 +0300 Subject: [PATCH] core: fix nondeterministic txGetReferences() behavior Ranging over map is nondeterministic and contracts may be unprepared for that. Fixes #454. --- pkg/core/interop_neo.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/core/interop_neo.go b/pkg/core/interop_neo.go index e1211cdfb..39623d6d0 100644 --- a/pkg/core/interop_neo.go +++ b/pkg/core/interop_neo.go @@ -144,8 +144,8 @@ func (ic *interopContext) txGetReferences(v *vm.VM) error { } stackrefs := make([]vm.StackItem, 0, len(refs)) - for k, v := range refs { - tio := txInOut{k, *v} + for _, k := range tx.Inputs { + tio := txInOut{*k, *refs[*k]} stackrefs = append(stackrefs, vm.NewInteropItem(tio)) } v.Estack().PushVal(stackrefs)