From ecd5835a565b4529f31532adc66b501eae37ee7f Mon Sep 17 00:00:00 2001 From: William Grzybowski Date: Mon, 18 Dec 2023 07:32:14 -0300 Subject: [PATCH] Workaround for 2.0.0-sweet --- pool/util.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pool/util.py b/pool/util.py index 185cc48..2f4abe2 100644 --- a/pool/util.py +++ b/pool/util.py @@ -44,6 +44,13 @@ def get_chia_version(self) -> Optional[str]: user_agent = self.headers.get('user-agent') 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]))