Skip to content

Commit

Permalink
Fix some merge errors (#2337)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang authored Feb 14, 2021
1 parent cddf6e8 commit ba6eef4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/neo/Ledger/MemoryPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/neo/Network/P2P/Payloads/Block.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public sealed class Block : IEquatable<Block>, IInventory
public void Deserialize(BinaryReader reader)
{
Header = reader.ReadSerializable<Header>();
Transactions = reader.ReadSerializableArray<Transaction>((int)ProtocolSettings.Default.MaxTransactionsPerBlock);
Transactions = reader.ReadSerializableArray<Transaction>(ushort.MaxValue);
if (Transactions.Distinct().Count() != Transactions.Length)
throw new FormatException();
if (MerkleTree.ComputeRoot(Transactions.Select(p => p.Hash).ToArray()) != Header.MerkleRoot)
Expand Down
2 changes: 1 addition & 1 deletion src/neo/Network/P2P/Payloads/MerkleBlockPayload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static MerkleBlockPayload Create(Block block, BitArray flags)
public void Deserialize(BinaryReader reader)
{
Header = reader.ReadSerializable<Header>();
TxCount = (int)reader.ReadVarInt(ProtocolSettings.Default.MaxTransactionsPerBlock);
TxCount = (int)reader.ReadVarInt(ushort.MaxValue);
Hashes = reader.ReadSerializableArray<UInt256>(TxCount);
Flags = reader.ReadVarBytes((Math.Max(TxCount, 1) + 7) / 8);
}
Expand Down
2 changes: 1 addition & 1 deletion src/neo/SmartContract/Native/TrimmedBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class TrimmedBlock : IInteroperable, ISerializable
public void Deserialize(BinaryReader reader)
{
Header = reader.ReadSerializable<Header>();
Hashes = reader.ReadSerializableArray<UInt256>((int)ProtocolSettings.Default.MaxTransactionsPerBlock);
Hashes = reader.ReadSerializableArray<UInt256>(ushort.MaxValue);
}

public void Serialize(BinaryWriter writer)
Expand Down

0 comments on commit ba6eef4

Please sign in to comment.