diff --git a/chia/farmer/farmer.py b/chia/farmer/farmer.py index 760f6c3f18f8..5d9a6c7c5ed9 100644 --- a/chia/farmer/farmer.py +++ b/chia/farmer/farmer.py @@ -19,7 +19,7 @@ from chia.daemon.keychain_proxy import KeychainProxy, connect_to_keychain_and_validate, wrap_local_keychain from chia.plot_sync.delta import Delta from chia.plot_sync.receiver import Receiver -from chia.pools.pool_config import PoolWalletConfig, add_auth_key, load_pool_config, update_pool_url +from chia.pools.pool_config import PoolWalletConfig, load_pool_config, update_pool_url from chia.protocols import farmer_protocol, harvester_protocol from chia.protocols.pool_protocol import ( AuthenticationPayload, @@ -531,8 +531,6 @@ async def update_pool_state(self) -> None: self.log.error(f"Could not find authentication sk for {p2_singleton_puzzle_hash}") continue - add_auth_key(self._root_path, pool_config, authentication_sk.get_g1()) - if p2_singleton_puzzle_hash not in self.pool_state: self.pool_state[p2_singleton_puzzle_hash] = { "p2_singleton_puzzle_hash": p2_singleton_puzzle_hash.hex(), diff --git a/chia/pools/pool_config.py b/chia/pools/pool_config.py index 84a9e2e83d0f..cc106546615d 100644 --- a/chia/pools/pool_config.py +++ b/chia/pools/pool_config.py @@ -62,26 +62,6 @@ def load_pool_config(root_path: Path) -> List[PoolWalletConfig]: return ret_list -# TODO: remove this a few versions after 1.3, since authentication_public_key is deprecated. This is here to support -# downgrading to versions older than 1.3. -def add_auth_key(root_path: Path, pool_wallet_config: PoolWalletConfig, auth_key: G1Element) -> None: - def update_auth_pub_key_for_entry(config_entry: Dict[str, Any]) -> bool: - auth_key_hex = bytes(auth_key).hex() - if config_entry.get("authentication_public_key", "") != auth_key_hex: - config_entry["authentication_public_key"] = auth_key_hex - - return True - - return False - - update_pool_config_entry( - root_path=root_path, - pool_wallet_config=pool_wallet_config, - update_closure=update_auth_pub_key_for_entry, - update_log_message=f"Updating pool config for auth key: {auth_key}", - ) - - def update_pool_url(root_path: Path, pool_wallet_config: PoolWalletConfig, pool_url: str) -> None: def update_pool_url_for_entry(config_entry: Dict[str, Any]) -> bool: if config_entry.get("pool_url", "") != pool_url: @@ -107,21 +87,20 @@ def update_pool_config_entry( ) -> None: with lock_and_load_config(root_path, "config.yaml") as config: pool_list = config["pool"].get("pool_list", []) + if pool_list is None: + return updated = False - if pool_list is not None: - for pool_config_dict in pool_list: - try: - if hexstr_to_bytes(pool_config_dict["owner_public_key"]) == bytes( - pool_wallet_config.owner_public_key - ): - if update_closure(pool_config_dict): - updated = True - except Exception as e: - log.error(f"Exception updating config: {pool_config_dict} {e}") - if updated: - log.info(update_log_message) - config["pool"]["pool_list"] = pool_list - save_config(root_path, "config.yaml", config) + for pool_config_dict in pool_list: + try: + if hexstr_to_bytes(pool_config_dict["owner_public_key"]) == bytes(pool_wallet_config.owner_public_key): + if update_closure(pool_config_dict): + updated = True + except Exception as e: + log.error(f"Exception updating config: {pool_config_dict} {e}") + if updated: + log.info(update_log_message) + config["pool"]["pool_list"] = pool_list + save_config(root_path, "config.yaml", config) async def update_pool_config(root_path: Path, pool_config_list: List[PoolWalletConfig]) -> None: