Skip to content

Commit

Permalink
Prevent create key if not null
Browse files Browse the repository at this point in the history
  • Loading branch information
shargon committed Oct 29, 2020
1 parent 2c8cf6e commit 0b5473a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ApplicationLogs/LogReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ public void OnPersist(StoreView snapshot, IReadOnlyList<Blockchain.ApplicationEx
}
return notification;
}).ToArray();
var systemKey = snapshot.PersistingBlock.Hash.ToArray().Concat(new byte[] { (byte)appExec.Trigger }).ToArray();
writeBatch.Put(appExec.Transaction?.Hash.ToArray() ?? systemKey, Encoding.UTF8.GetBytes(json.ToString()));
writeBatch.Put(appExec.Transaction?.Hash.ToArray() ??
snapshot.PersistingBlock.Hash.ToArray().Concat(new byte[] { (byte)appExec.Trigger }).ToArray(),
Encoding.UTF8.GetBytes(json.ToString()));
}
db.Write(WriteOptions.Default, writeBatch);
}
Expand Down

0 comments on commit 0b5473a

Please sign in to comment.