+ } else if error_count == NUMBER_SUCCESSIVE_ERRORS_SEND_EMEGENCY_EMAIL {
+ // Send e-mail.
+ println!("Sending EMERGENCY email...");
+ match send_email(
+ "[EMERGENCY] Watchdog: Staking error",
+ &format!(
+ "[EMERGENCY] Error: {}\n\nNumber of error: {}",
+ error, error_count
+ ),
+ &config.smtp_relay_address,
+ &config.smtp_login,
+ &config.smtp_password,
+ ) {
+ Err(email_error) => println!("Error sending email: {:?}", email_error),
+ _ => {
+ println!("Email successfully sent");
+ time_last_email_send = time::Instant::now();
+ }
+ }