mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-22 00:52:32 +03:00
Strip IPv6 [] correctly even with non-4-character segments (#9249)
* Strip IPv6 [] correctly even with non-4-character segments For example, the existing code failed to properly strip `[____:____:____:600:____:a2:____:____]` resulting in the trailing `]` below. (four character segments and node id redacted with `_`) ``` FULL_NODE ____:____:____:600:____:a2:____:____] 8444/8444 ________... Nov 12 20:46:47 1.5|18.9 -SB Height: 1131954 -Hash: 344cbef3... ``` * Simply IPv6 strip Technically this hazards stripping multiple brackets from either end or a right bracket from the left, etc. Perhaps this is ok.
This commit is contained in:
parent
4b389c8fc0
commit
d45f8db533
@ -118,8 +118,7 @@ async def show_async(
|
||||
|
||||
host = con["peer_host"]
|
||||
# Strip IPv6 brackets
|
||||
if host[0] == "[":
|
||||
host = host[1:39]
|
||||
host = host.strip("[]")
|
||||
# Nodetype length is 9 because INTRODUCER will be deprecated
|
||||
if NodeType(con["type"]) is NodeType.FULL_NODE:
|
||||
peak_height = con["peak_height"]
|
||||
|
Loading…
Reference in New Issue
Block a user