Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Neo/VM/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ private static JObject ToJson(StackItem item, HashSet<StackItem> context, ref in
case Array array:
{
context ??= new HashSet<StackItem>(ReferenceEqualityComparer.Instance);
if (!context.Add(array)) throw new InvalidOperationException();
if (!context.Add(array)) throw new InvalidOperationException("Circular reference.");
maxSize -= 2/*[]*/+ Math.Max(0, (array.Count - 1))/*,*/;
JArray a = new();
foreach (StackItem stackItem in array)
Expand Down Expand Up @@ -398,7 +398,7 @@ private static JObject ToJson(StackItem item, HashSet<StackItem> context, ref in
case Map map:
{
context ??= new HashSet<StackItem>(ReferenceEqualityComparer.Instance);
if (!context.Add(map)) throw new InvalidOperationException();
if (!context.Add(map)) throw new InvalidOperationException("Circular reference.");
maxSize -= 2/*[]*/+ Math.Max(0, (map.Count - 1))/*,*/;
JArray a = new();
foreach (var (k, v) in map)
Expand Down