From 19813f50759a1eca2c5f1d6f3044fc51a86761a0 Mon Sep 17 00:00:00 2001 From: superboyiii <573504781@qq.com> Date: Tue, 11 Jun 2024 17:45:31 +0800 Subject: [PATCH] fix patch from: https://github.com/neo-project/neo/pull/3261 and https://github.com/neo-project/neo/pull/3299 --- src/ApplicationLogs/Store/LogStorageStore.cs | 2 +- src/RpcServer/RpcServer.SmartContract.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ApplicationLogs/Store/LogStorageStore.cs b/src/ApplicationLogs/Store/LogStorageStore.cs index aa0357ffb..0e8dedb86 100644 --- a/src/ApplicationLogs/Store/LogStorageStore.cs +++ b/src/ApplicationLogs/Store/LogStorageStore.cs @@ -162,7 +162,7 @@ public Guid PutStackItemState(StackItem stackItem) { _snapshot.Put(key, BinarySerializer.Serialize(stackItem, ExecutionEngineLimits.Default with { MaxItemSize = (uint)Settings.Default.MaxStackSize })); } - catch (NotSupportedException) + catch { _snapshot.Put(key, BinarySerializer.Serialize(StackItem.Null, ExecutionEngineLimits.Default with { MaxItemSize = (uint)Settings.Default.MaxStackSize })); } diff --git a/src/RpcServer/RpcServer.SmartContract.cs b/src/RpcServer/RpcServer.SmartContract.cs index 0fe6fc0c1..92ea7ff62 100644 --- a/src/RpcServer/RpcServer.SmartContract.cs +++ b/src/RpcServer/RpcServer.SmartContract.cs @@ -246,7 +246,7 @@ protected virtual JToken TraverseIterator(JArray _params) Guid sid = Result.Ok_Or(() => Guid.Parse(_params[0].GetString()), RpcError.InvalidParams.WithData($"Invalid session id {nameof(sid)}")); Guid iid = Result.Ok_Or(() => Guid.Parse(_params[1].GetString()), RpcError.InvalidParams.WithData($"Invliad iterator id {nameof(iid)}")); int count = _params[2].GetInt32(); - Result.True_Or(() => count > settings.MaxIteratorResultItems, RpcError.InvalidParams.WithData($"Invalid iterator items count {nameof(count)}")); + Result.True_Or(() => count <= settings.MaxIteratorResultItems, RpcError.InvalidParams.WithData($"Invalid iterator items count {nameof(count)}")); Session session; lock (sessions) {