Skip to content

Commit

Permalink
Clean up kes.start if pool cert is absent
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg B committed Nov 24, 2024
1 parent aa8a028 commit 4923db4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/cnode-helper-scripts/cntools.library
Original file line number Diff line number Diff line change
Expand Up @@ -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 '[
Expand Down

0 comments on commit 4923db4

Please sign in to comment.