vm: break circular references when recursing into ToContractParameters
Reference types can have circular pointers to each other, thus we need to control recursion.
This commit is contained in:
parent
3282c6ed41
commit
9b4fd99fbc
4 changed files with 37 additions and 23 deletions
|
@ -6,6 +6,7 @@ import (
|
|||
"github.com/CityOfZion/neo-go/pkg/core/state"
|
||||
"github.com/CityOfZion/neo-go/pkg/smartcontract"
|
||||
"github.com/CityOfZion/neo-go/pkg/util"
|
||||
"github.com/CityOfZion/neo-go/pkg/vm"
|
||||
)
|
||||
|
||||
// ApplicationLog wrapper used for the representation of the
|
||||
|
@ -35,7 +36,8 @@ type NotificationEvent struct {
|
|||
func NewApplicationLog(appExecRes *state.AppExecResult, scriptHash util.Uint160) ApplicationLog {
|
||||
events := make([]NotificationEvent, 0, len(appExecRes.Events))
|
||||
for _, e := range appExecRes.Events {
|
||||
item := e.Item.ToContractParameter()
|
||||
seen := make(map[vm.StackItem]bool)
|
||||
item := e.Item.ToContractParameter(seen)
|
||||
events = append(events, NotificationEvent{
|
||||
Contract: e.ScriptHash,
|
||||
Item: item,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue