mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-01-11 11:20:38 +00:00
core: fix nondeterministic txGetReferences() behavior
Ranging over map is nondeterministic and contracts may be unprepared for that. Fixes #454.
This commit is contained in:
parent
5e8122bfac
commit
01082a8988
1 changed files with 2 additions and 2 deletions
|
@ -144,8 +144,8 @@ func (ic *interopContext) txGetReferences(v *vm.VM) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
stackrefs := make([]vm.StackItem, 0, len(refs))
|
stackrefs := make([]vm.StackItem, 0, len(refs))
|
||||||
for k, v := range refs {
|
for _, k := range tx.Inputs {
|
||||||
tio := txInOut{k, *v}
|
tio := txInOut{*k, *refs[*k]}
|
||||||
stackrefs = append(stackrefs, vm.NewInteropItem(tio))
|
stackrefs = append(stackrefs, vm.NewInteropItem(tio))
|
||||||
}
|
}
|
||||||
v.Estack().PushVal(stackrefs)
|
v.Estack().PushVal(stackrefs)
|
||||||
|
|
Loading…
Reference in a new issue