#!/usr/bin/env bash set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" SKILL_ROOT="$(dirname "$SCRIPT_DIR")" source "$SCRIPT_DIR/_common.sh" : "${BTC_NETWORK:=testnet}" main() { [[ -f "$SKILL_ROOT/outputs/last_run_dir.txt" ]] || die "No last run." run_dir="$(cat "$SKILL_ROOT/outputs/last_run_dir.txt")" status="$run_dir/status_matrix.json" flag="$(net_flag)" ok_proof=false; ok_txid=false; ok_seen=false [[ -f "$run_dir/PROOF.json" ]] && ok_proof=true if [[ -f "$run_dir/txid.txt" ]]; then txid="$(cat "$run_dir/txid.txt")" [[ -n "$txid" ]] && ok_txid=true if bitcoin-cli $flag getrawtransaction "$txid" >/dev/null 2>&1; then ok_seen=true fi fi blockers="[]" if [[ "$ok_txid" != "true" ]]; then blockers='["missing_txid"]' elif [[ "$ok_seen" != "true" ]]; then blockers='["tx_not_found_yet_mempool_or_index"]' fi cat > "$status" <