From bd56d8470c61151ecef9d2ee1e54ef25e427b02f Mon Sep 17 00:00:00 2001 From: erikzhang Date: Thu, 20 Aug 2020 15:38:10 +0800 Subject: [PATCH] Throw exception --- src/neo/SmartContract/Native/Tokens/NeoToken.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/neo/SmartContract/Native/Tokens/NeoToken.cs b/src/neo/SmartContract/Native/Tokens/NeoToken.cs index 08371a3fbf..ca06d8378c 100644 --- a/src/neo/SmartContract/Native/Tokens/NeoToken.cs +++ b/src/neo/SmartContract/Native/Tokens/NeoToken.cs @@ -109,7 +109,8 @@ protected override void OnPersist(ApplicationEngine engine) [ContractMethod(0_05000000, CallFlags.AllowModifyStates)] private bool SetGasPerBlock(ApplicationEngine engine, BigInteger gasPerBlock) { - if (gasPerBlock < 0 || gasPerBlock > 10 * GAS.Factor) return false; + if (gasPerBlock < 0 || gasPerBlock > 10 * GAS.Factor) + throw new ArgumentOutOfRangeException(nameof(gasPerBlock)); if (!CheckCommittee(engine)) return false; GasRecord gasRecord = engine.Snapshot.Storages.GetAndChange(CreateStorageKey(Prefix_GasPerBlock)).GetInteroperable(); if (gasRecord[^1].Index == engine.Snapshot.PersistingBlock.Index)