Skip to content

Commit

Permalink
Throw exception
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang committed Aug 20, 2020
1 parent 4ac4325 commit bd56d84
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/neo/SmartContract/Native/Tokens/NeoToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<GasRecord>();
if (gasRecord[^1].Index == engine.Snapshot.PersistingBlock.Index)
Expand Down

0 comments on commit bd56d84

Please sign in to comment.