Skip to content

Commit

Permalink
Set limits in MerkleBlockPayload (3x) (neo-project#1377)
Browse files Browse the repository at this point in the history
* Set limits in MerkleBlockPayload (3x)

* Update MerkleBlockPayload.cs

* Update src/neo/Network/P2P/Payloads/MerkleBlockPayload.cs

Co-Authored-By: Erik Zhang <[email protected]>

* Update MerkleBlockPayload.cs

Co-authored-by: Erik Zhang <[email protected]>
  • Loading branch information
2 people authored and Luchuan committed Jan 10, 2020
1 parent 38c0d6b commit fefd2f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/neo/Network/P2P/Payloads/MerkleBlockPayload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public static MerkleBlockPayload Create(Block block, BitArray flags)
public override void Deserialize(BinaryReader reader)
{
base.Deserialize(reader);
ContentCount = (int)reader.ReadVarInt(int.MaxValue);
Hashes = reader.ReadSerializableArray<UInt256>();
Flags = reader.ReadVarBytes();
ContentCount = (int)reader.ReadVarInt(Block.MaxTransactionsPerBlock + 1);
Hashes = reader.ReadSerializableArray<UInt256>(ContentCount);
Flags = reader.ReadVarBytes((ContentCount + 7) / 8);
}

public override void Serialize(BinaryWriter writer)
Expand Down

0 comments on commit fefd2f4

Please sign in to comment.