From 7df68fc8525e2b4620de9d6e3949354d0a972aeb Mon Sep 17 00:00:00 2001 From: cn1010 <1062108372@qq.com> Date: Tue, 17 Mar 2020 16:27:29 +0800 Subject: [PATCH] fix BigInteger0 storage outputs null (#1471) --- src/neo/SmartContract/InteropService.Storage.cs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/neo/SmartContract/InteropService.Storage.cs b/src/neo/SmartContract/InteropService.Storage.cs index a9fc9e9303..e732cf8b60 100644 --- a/src/neo/SmartContract/InteropService.Storage.cs +++ b/src/neo/SmartContract/InteropService.Storage.cs @@ -63,17 +63,10 @@ private static bool PutExInternal(ApplicationEngine engine, StorageContext conte if (engine.Snapshot.Storages.TryGet(skey)?.IsConstant == true) return false; - if (value.Length == 0 && !flags.HasFlag(StorageFlags.Constant)) - { - // If put 'value' is empty (and non-const), we remove it (implicit `Storage.Delete`) - engine.Snapshot.Storages.Delete(skey); - } - else - { - StorageItem item = engine.Snapshot.Storages.GetAndChange(skey, () => new StorageItem()); - item.Value = value; - item.IsConstant = flags.HasFlag(StorageFlags.Constant); - } + StorageItem item = engine.Snapshot.Storages.GetAndChange(skey, () => new StorageItem()); + item.Value = value; + item.IsConstant = flags.HasFlag(StorageFlags.Constant); + return true; }