Skip to content

Commit

Permalink
Remove anything after dash
Browse files Browse the repository at this point in the history
  • Loading branch information
william-gr committed Dec 18, 2023
1 parent ecd5835 commit 3ac7801
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pool/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,9 @@ def get_chia_version(self) -> Optional[str]:
if not user_agent:
return

mapping = {
'2.0.0-sweet': '2.0.0',
}
if user_agent in mapping:
return Version(mapping[user_agent])

if user_agent.startswith('Chia Blockchain v.'):
try:
return Version('.'.join(user_agent.split('Chia Blockchain v.', 1)[-1].split('.', 3)[:3]))
return Version('.'.join(user_agent.split('Chia Blockchain v.', 1)[-1].split('-')[0].split('.', 3)[:3]))
except Exception as e:
logger.error('Failed to parse chia version %r: %r', user_agent, e)
return
Expand Down

0 comments on commit 3ac7801

Please sign in to comment.