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 <erik@neo.org>

* Update MerkleBlockPayload.cs

Co-authored-by: Erik Zhang <erik@neo.org>
  • Loading branch information
2 people authored and Tommo-L committed Jun 22, 2020
1 parent 9372f8f commit aa73ecb
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 aa73ecb

Please sign in to comment.