Skip to content

Commit

Permalink
Set limits in MerkleBlockPayload (3x) (#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 <erik@neo.org>

* Update MerkleBlockPayload.cs

Co-authored-by: Erik Zhang <erik@neo.org>
  • Loading branch information
shargon and erikzhang committed Dec 26, 2019
1 parent def1e83 commit 0130876
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/neo/Network/P2P/Payloads/MerkleBlockPayload.cs
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 0130876

Please sign in to comment.