diff --git a/src/neo/Ledger/MemoryPool.cs b/src/neo/Ledger/MemoryPool.cs index 07cb1f5fde..11f54173c0 100644 --- a/src/neo/Ledger/MemoryPool.cs +++ b/src/neo/Ledger/MemoryPool.cs @@ -367,7 +367,7 @@ internal void UpdatePoolForBlockPersisted(Block block, DataCache snapshot) if (block.Index > 0 && _system.HeaderCache.Count > 0) return; - ReverifyTransactions(_sortedTransactions, _unverifiedSortedTransactions, (int)ProtocolSettings.Default.MaxTransactionsPerBlock, MaxMillisecondsToReverifyTx, snapshot); + ReverifyTransactions(_sortedTransactions, _unverifiedSortedTransactions, (int)_system.Settings.MaxTransactionsPerBlock, MaxMillisecondsToReverifyTx, snapshot); } internal void InvalidateAllTransactions() @@ -466,7 +466,7 @@ internal bool ReVerifyTopUnverifiedTransactionsIfNeeded(int maxToVerify, DataCac if (_unverifiedSortedTransactions.Count > 0) { - int verifyCount = _sortedTransactions.Count > ProtocolSettings.Default.MaxTransactionsPerBlock ? 1 : maxToVerify; + int verifyCount = _sortedTransactions.Count > _system.Settings.MaxTransactionsPerBlock ? 1 : maxToVerify; ReverifyTransactions(_sortedTransactions, _unverifiedSortedTransactions, verifyCount, MaxMillisecondsToReverifyTxPerIdle, snapshot); } diff --git a/src/neo/Network/P2P/Payloads/Block.cs b/src/neo/Network/P2P/Payloads/Block.cs index 1f55dfefce..83827ac5ed 100644 --- a/src/neo/Network/P2P/Payloads/Block.cs +++ b/src/neo/Network/P2P/Payloads/Block.cs @@ -31,7 +31,7 @@ public sealed class Block : IEquatable, IInventory public void Deserialize(BinaryReader reader) { Header = reader.ReadSerializable
(); - Transactions = reader.ReadSerializableArray((int)ProtocolSettings.Default.MaxTransactionsPerBlock); + Transactions = reader.ReadSerializableArray(ushort.MaxValue); if (Transactions.Distinct().Count() != Transactions.Length) throw new FormatException(); if (MerkleTree.ComputeRoot(Transactions.Select(p => p.Hash).ToArray()) != Header.MerkleRoot) diff --git a/src/neo/Network/P2P/Payloads/MerkleBlockPayload.cs b/src/neo/Network/P2P/Payloads/MerkleBlockPayload.cs index 98ec7050cd..84a3162ff2 100644 --- a/src/neo/Network/P2P/Payloads/MerkleBlockPayload.cs +++ b/src/neo/Network/P2P/Payloads/MerkleBlockPayload.cs @@ -34,7 +34,7 @@ public static MerkleBlockPayload Create(Block block, BitArray flags) public void Deserialize(BinaryReader reader) { Header = reader.ReadSerializable
(); - TxCount = (int)reader.ReadVarInt(ProtocolSettings.Default.MaxTransactionsPerBlock); + TxCount = (int)reader.ReadVarInt(ushort.MaxValue); Hashes = reader.ReadSerializableArray(TxCount); Flags = reader.ReadVarBytes((Math.Max(TxCount, 1) + 7) / 8); } diff --git a/src/neo/SmartContract/Native/TrimmedBlock.cs b/src/neo/SmartContract/Native/TrimmedBlock.cs index d7a9078b62..d0d5de8aec 100644 --- a/src/neo/SmartContract/Native/TrimmedBlock.cs +++ b/src/neo/SmartContract/Native/TrimmedBlock.cs @@ -21,7 +21,7 @@ public class TrimmedBlock : IInteroperable, ISerializable public void Deserialize(BinaryReader reader) { Header = reader.ReadSerializable
(); - Hashes = reader.ReadSerializableArray((int)ProtocolSettings.Default.MaxTransactionsPerBlock); + Hashes = reader.ReadSerializableArray(ushort.MaxValue); } public void Serialize(BinaryWriter writer)