diff --git a/stake-o-matic/src/main.rs b/stake-o-matic/src/main.rs index 1171245c67..7355e2043d 100644 --- a/stake-o-matic/src/main.rs +++ b/stake-o-matic/src/main.rs @@ -646,6 +646,12 @@ fn main() -> Result<(), Box> { process::exit(1); } + // Sanity check that the RPC endpoint is healthy before performing too much work + rpc_client.get_health().unwrap_or_else(|err| { + error!("RPC endpoint is unhealthy: {:?}", err); + process::exit(1); + }); + let source_stake_balance = validate_source_stake_account(&rpc_client, &config)?; let epoch_info = rpc_client.get_epoch_info()?;