mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-30 09:33:36 +00:00
core: adjust System.Blockchain.GetTransactionFromBlock interop
To match C# implementation, we should pick all arguments from stack first.
This commit is contained in:
parent
a1f98f92fe
commit
74ffde8367
1 changed files with 1 additions and 1 deletions
|
@ -155,12 +155,12 @@ func bcGetTransactionFromBlock(ic *interop.Context, v *vm.VM) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
index := v.Estack().Pop().BigInt().Int64()
|
||||||
block, err := ic.DAO.GetBlock(hash)
|
block, err := ic.DAO.GetBlock(hash)
|
||||||
if err != nil || !isTraceableBlock(ic, block.Index) {
|
if err != nil || !isTraceableBlock(ic, block.Index) {
|
||||||
v.Estack().PushVal(stackitem.Null{})
|
v.Estack().PushVal(stackitem.Null{})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
index := v.Estack().Pop().BigInt().Int64()
|
|
||||||
if index < 0 || index >= int64(len(block.Transactions)) {
|
if index < 0 || index >= int64(len(block.Transactions)) {
|
||||||
return errors.New("wrong transaction index")
|
return errors.New("wrong transaction index")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue