We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 433298c commit 32f860fCopy full SHA for 32f860f
alerts/sender_with_alert.sh
@@ -181,7 +181,12 @@ done
181
wei_to_eth_division_factor=$((10**18))
182
spent_amount=$(echo "scale=30; $total_fee_in_wei / (10^18)" | bc -l | awk '{printf "%.15f", $0}')
183
184
-eth_usd=$(curl -s https://cryptoprices.cc/ETH/)
+eth_usd=$(curl -s --connect-timeout 10 --max-time 30 https://cryptoprices.cc/ETH/ 2>/dev/null)
185
+if [[ -z "$eth_usd" ]] || ! [[ "$eth_usd" =~ ^[0-9]+\.?[0-9]*$ ]]; then
186
+ echo "Warning: Could not fetch ETH price, using fallback value of 4000"
187
+ eth_usd=4000
188
+fi
189
+
190
spent_amount_usd=$(echo "$spent_amount * $eth_usd" | bc | awk '{printf "%.2f", $1}')
191
192
verified=1
0 commit comments