core: fix wrong references ordering in interop function

Broken by 9f7018503a. Almost the same problem as
in 01082a8988 (though it is deterministic now,
just not the way the contract expects).
This commit is contained in:
Roman Khimov 2020-03-06 19:18:54 +03:00
parent 0e8ff558d1
commit ced5ddbb9e

View file

@ -144,8 +144,13 @@ func (ic *interopContext) txGetReferences(v *vm.VM) error {
}
stackrefs := make([]vm.StackItem, 0, len(refs))
for _, tio := range refs {
stackrefs = append(stackrefs, vm.NewInteropItem(tio))
for i := range tx.Inputs {
for j := range refs {
if refs[j].In == tx.Inputs[i] {
stackrefs = append(stackrefs, vm.NewInteropItem(refs[j]))
break
}
}
}
v.Estack().PushVal(stackrefs)
return nil