From 58b3d138dc9b6b4233086a821622dc0a72830c78 Mon Sep 17 00:00:00 2001 From: Shargon Date: Thu, 29 Aug 2019 09:00:21 +0200 Subject: [PATCH] Fix Runtime_GetNotifications (#1073) --- neo/SmartContract/InteropService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neo/SmartContract/InteropService.cs b/neo/SmartContract/InteropService.cs index 8651dfbc3d..6868da1886 100644 --- a/neo/SmartContract/InteropService.cs +++ b/neo/SmartContract/InteropService.cs @@ -238,13 +238,13 @@ private static bool Runtime_GetNotifications(ApplicationEngine engine) { var data = engine.CurrentContext.EvaluationStack.Pop().GetByteArray(); if (data.Length != UInt160.Length) return false; - if (!engine.CheckArraySize(engine.Notifications.Count)) return false; var hash = new UInt160(data); IEnumerable notifications = engine.Notifications; if (!hash.Equals(UInt160.Zero)) notifications = notifications.Where(p => p.ScriptHash == hash); + if (!engine.CheckArraySize(notifications.Count())) return false; engine.CurrentContext.EvaluationStack.Push(notifications.Select(u => new VM.Types.Array(new StackItem[] { u.ScriptHash.ToArray(), u.State })).ToArray()); return true; }