Skip to content

Commit

Permalink
Fix Runtime_GetNotifications (#1073)
Browse files Browse the repository at this point in the history
  • Loading branch information
shargon authored Aug 29, 2019
1 parent 0bd198e commit 919cc80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion neo/SmartContract/InteropService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<NotifyEventArgs> 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;
}
Expand Down

0 comments on commit 919cc80

Please sign in to comment.