Skip to content

Commit

Permalink
Fix new pool url detection
Browse files Browse the repository at this point in the history
  • Loading branch information
felixbrucker committed Aug 24, 2024
1 parent c9ff6b6 commit f40b773
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 3 additions & 2 deletions chia/farmer/farmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,9 @@ async def _pool_get_pool_info(self, pool_config: PoolWalletConfig) -> Optional[G
response: Dict[str, Any] = json.loads(await resp.text())
self.log.info(f"GET /pool_info response: {response}")
new_pool_url: Optional[str] = None
if resp.url != url and all(r.status in {301, 308} for r in resp.history):
new_pool_url = f"{resp.url}".replace("/pool_info", "")
response_url_str = f"{resp.url}"
if response_url_str != url and len(resp.history) > 0 and all(r.status in {301, 308} for r in resp.history):
new_pool_url = response_url_str.replace("/pool_info", "")

return GetPoolInfoResult(pool_info=response, new_pool_url=new_pool_url)
else:
Expand Down
4 changes: 1 addition & 3 deletions chia/pools/pool_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,11 @@ def update_pool_config_entry(
if update_closure(pool_config_dict):
updated = True
except Exception as e:
log.error(f"Exception updating config: {pool_config_dict} {e}")
log.error(f"Exception updating pool config {pool_config_dict} for launcher_id {pool_wallet_config.launcher_id}: {e}")
if updated:
log.info(update_log_message)
config["pool"]["pool_list"] = pool_list
save_config(root_path, "config.yaml", config)
else:
log.error(f"Failed to update pool config entry for launcher_id {pool_wallet_config.launcher_id}")


async def update_pool_config(root_path: Path, pool_config_list: List[PoolWalletConfig]) -> None:
Expand Down

0 comments on commit f40b773

Please sign in to comment.