From 4923db4f485a403d800249d296ef8deb0fc775e7 Mon Sep 17 00:00:00 2001 From: Greg B Date: Sun, 24 Nov 2024 23:41:09 +1100 Subject: [PATCH] Clean up kes.start if pool cert is absent --- scripts/cnode-helper-scripts/cntools.library | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/cnode-helper-scripts/cntools.library b/scripts/cnode-helper-scripts/cntools.library index 665061024..2d6326ffe 100644 --- a/scripts/cnode-helper-scripts/cntools.library +++ b/scripts/cnode-helper-scripts/cntools.library @@ -762,13 +762,14 @@ isPoolRegistered() { unset p_active_epoch_no p_vrf_key_hash p_margin p_fixed_cost p_pledge p_reward_addr p_owners p_relays p_meta_url p_meta_hash p_meta_json p_pool_status unset p_retiring_epoch p_op_cert p_op_cert_counter p_active_stake p_epoch_block_cnt p_live_stake p_live_delegators p_live_saturation if [[ ${CNTOOLS_MODE} != "LIGHT" ]]; then - [[ -f "${POOL_FOLDER}/${1}/${POOL_REGCERT_FILENAME}" ]] && return 2 || return 1 + [[ -f "${POOL_FOLDER}/${1}/${POOL_REGCERT_FILENAME}" ]] && return 2 || (rm -rf "${POOL_FOLDER}/${1}/${POOL_CURRENT_KES_START}" && return 1) else getPoolID "$1" HEADERS=("${KOIOS_API_HEADERS[@]}" -H "Content-Type: application/json") println ACTION "curl -sSL -f -X POST ${HEADERS[*]} -d '{\"_pool_bech32_ids\":[\"${pool_id_bech32}\"]}' ${KOIOS_API}/pool_info" ! pool_info=$(curl -sSL -f -X POST "${HEADERS[@]}" -d '{"_pool_bech32_ids":["'${pool_id_bech32}'"]}' "${KOIOS_API}/pool_info" 2>&1) && error_msg=${pool_info} && return 0 if [[ ${pool_info} = '[]' ]]; then + # possibly more cleanup needed, like rm -rf "${POOL_FOLDER}/${1}/${POOL_CURRENT_KES_START}" and ${POOL_REGCERT_FILENAME} if retirement was issued outside of CNTools? return 1 fi pool_info_tsv=$(jq -r '[