From c0a411474db817d6217c9a3a28a41e67f0947561 Mon Sep 17 00:00:00 2001 From: cn1010 Date: Wed, 8 Apr 2020 12:56:04 +0800 Subject: [PATCH] remove round up sysfee (#1522) --- src/neo/Network/P2P/Payloads/Transaction.cs | 1 - src/neo/Wallets/Wallet.cs | 9 --------- 2 files changed, 10 deletions(-) diff --git a/src/neo/Network/P2P/Payloads/Transaction.cs b/src/neo/Network/P2P/Payloads/Transaction.cs index f5a17fbf11..6035ac2285 100644 --- a/src/neo/Network/P2P/Payloads/Transaction.cs +++ b/src/neo/Network/P2P/Payloads/Transaction.cs @@ -172,7 +172,6 @@ public void DeserializeUnsigned(BinaryReader reader) Sender = reader.ReadSerializable(); SystemFee = reader.ReadInt64(); if (SystemFee < 0) throw new FormatException(); - if (SystemFee % NativeContract.GAS.Factor != 0) throw new FormatException(); NetworkFee = reader.ReadInt64(); if (NetworkFee < 0) throw new FormatException(); if (SystemFee + NetworkFee < SystemFee) throw new FormatException(); diff --git a/src/neo/Wallets/Wallet.cs b/src/neo/Wallets/Wallet.cs index 722c4dadea..0c8151a257 100644 --- a/src/neo/Wallets/Wallet.cs +++ b/src/neo/Wallets/Wallet.cs @@ -319,15 +319,6 @@ private Transaction MakeTransaction(StoreView snapshot, byte[] script, Transacti if (engine.State.HasFlag(VMState.FAULT)) throw new InvalidOperationException($"Failed execution for '{script.ToHexString()}'"); tx.SystemFee = Math.Max(engine.GasConsumed - ApplicationEngine.GasFree, 0); - if (tx.SystemFee > 0) - { - long d = (long)NativeContract.GAS.Factor; - long remainder = tx.SystemFee % d; - if (remainder > 0) - tx.SystemFee += d - remainder; - else if (remainder < 0) - tx.SystemFee -= remainder; - } } UInt160[] hashes = tx.GetScriptHashesForVerifying(snapshot);