Bug: Inconsistent Error Handling in Wallet Balance Check
Description
The wallet balance check script in scripts/check_balance.sh doesn't properly handle network failures, which can lead to misleading error messages.
Location
- File:
scripts/check_balance.sh
- Lines: 15-20
Expected Behavior
When the network is unavailable or the RPC endpoint times out, the script should clearly indicate a network error.
Actual Behavior
The script silently fails with exit code 0 and prints "Balance: 0 RTC" even when no actual balance check was performed.
Steps to Reproduce
- Disconnect from network
- Run:
./scripts/check_balance.sh AhqbFaPBPLMMiaLDzA9WhQcyvv4hMxiteLhPk3NhG1iG
- Observe output shows "Balance: 0 RTC" instead of network error
Suggested Fix
Add explicit error checking for curl responses:
response=$(curl -s -w "%{http_code}" "$RPC_ENDPOINT/balance?wallet=$WALLET")
http_code=${response: -3}
body=${response%???}
if [ "$http_code" != "200" ]; then
echo "Error: Failed to check balance (HTTP $http_code)"
exit 1
fi
Impact
- Low severity but affects user experience
- Can confuse users troubleshooting miner setup
- Might mask actual network issues
Environment
- OS: Linux (WSL2)
- RustChain version: Latest from main branch
- Date: 2026-07-05
Bug: Inconsistent Error Handling in Wallet Balance Check
Description
The wallet balance check script in
scripts/check_balance.shdoesn't properly handle network failures, which can lead to misleading error messages.Location
scripts/check_balance.shExpected Behavior
When the network is unavailable or the RPC endpoint times out, the script should clearly indicate a network error.
Actual Behavior
The script silently fails with exit code 0 and prints "Balance: 0 RTC" even when no actual balance check was performed.
Steps to Reproduce
./scripts/check_balance.sh AhqbFaPBPLMMiaLDzA9WhQcyvv4hMxiteLhPk3NhG1iGSuggested Fix
Add explicit error checking for curl responses:
Impact
Environment