forked from LBRYCommunity/lbry-sdk
1 and 65536 arent valid ports
This commit is contained in:
parent
2e2c751d75
commit
18d80f4ed5
1 changed files with 2 additions and 2 deletions
|
@ -154,9 +154,9 @@ class KademliaPeer:
|
|||
if self._node_id is not None:
|
||||
if not len(self._node_id) == constants.hash_length:
|
||||
raise ValueError("invalid node_id: {}".format(hexlify(self._node_id).decode()))
|
||||
if self.udp_port is not None and not 0 <= self.udp_port <= 65536:
|
||||
if self.udp_port is not None and not 1 <= self.udp_port <= 65535:
|
||||
raise ValueError("invalid udp port")
|
||||
if self.tcp_port is not None and not 0 <= self.tcp_port <= 65536:
|
||||
if self.tcp_port is not None and not 1 <= self.tcp_port <= 65535:
|
||||
raise ValueError("invalid tcp port")
|
||||
if not is_valid_ipv4(self.address):
|
||||
raise ValueError("invalid ip address")
|
||||
|
|
Loading…
Reference in a new issue