Skip to content

Commit

Permalink
https://github.com/neo-project/neo/pull/2337
Browse files Browse the repository at this point in the history
  • Loading branch information
ixje committed Apr 19, 2021
1 parent 924c6c4 commit a4c9496
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions neo3/network/payloads/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def deserialize(self, reader: serialization.BinaryReader) -> None:
or if the merkle root does not included the calculated root.
"""
self.header = reader.read_serializable(Header)
self.transactions = reader.read_serializable_list(payloads.Transaction, max=settings.policy.max_tx_per_block)
self.transactions = reader.read_serializable_list(payloads.Transaction, max=0xFFFF)

if len(set(self.transactions)) != len(self.transactions):
raise ValueError("Deserialization error - block contains duplicate transaction")
Expand Down Expand Up @@ -294,7 +294,7 @@ def serialize(self, writer: serialization.BinaryWriter) -> None:

def deserialize(self, reader: serialization.BinaryReader) -> None:
self.header = reader.read_serializable(Header)
self.hashes = reader.read_serializable_list(types.UInt256, max=settings.policy.max_tx_per_block)
self.hashes = reader.read_serializable_list(types.UInt256, max=0xFFFF)

@classmethod
def _serializable_init(cls):
Expand Down Expand Up @@ -333,7 +333,7 @@ def deserialize(self, reader: serialization.BinaryReader) -> None:
reader: instance.
"""
self.header = reader.read_serializable(Header)
self.tx_count = reader.read_var_int(max=settings.policy.max_tx_per_block)
self.tx_count = reader.read_var_int(max=0xFFFF)
self.hashes = reader.read_serializable_list(types.UInt256, max=self.tx_count)
self.flags = reader.read_var_bytes(max=(max(self.tx_count, 1) + 7) // 8)

Expand Down

0 comments on commit a4c9496

Please sign in to comment.