Fix IPv6 typo to IPv4 for StringSession.save() (#3760)

This commit is contained in:
James R T 2022-03-07 00:47:35 +08:00 committed by GitHub
parent 08bb72ea6b
commit 2357116f01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,7 @@ class StringSession(MemorySession):
if self.dcs[self.state.dc_id].ipv6 is not None: if self.dcs[self.state.dc_id].ipv6 is not None:
ip = self.dcs[self.state.dc_id].ipv6.to_bytes(16, 'big', signed=False) ip = self.dcs[self.state.dc_id].ipv6.to_bytes(16, 'big', signed=False)
else: else:
ip = self.dcs[self.state.dc_id].ipv6.to_bytes(4, 'big', signed=False) ip = self.dcs[self.state.dc_id].ipv4.to_bytes(4, 'big', signed=False)
return CURRENT_VERSION + StringSession.encode(struct.pack( return CURRENT_VERSION + StringSession.encode(struct.pack(
_STRUCT_PREFORMAT.format(len(ip)), _STRUCT_PREFORMAT.format(len(ip)),