diff --git a/Cargo.lock b/Cargo.lock index 8c821ce..2d59da4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2309,7 +2309,7 @@ dependencies = [ [[package]] name = "mars-cli" -version = "0.5.4" +version = "0.5.5" dependencies = [ "bincode", "bs58 0.5.1", diff --git a/Cargo.toml b/Cargo.toml index 3fc806b..773ac63 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mars-cli" -version = "0.5.4" +version = "0.5.5" description = "A command line interface for the Mars program." license = "Apache-2.0" edition = "2021" diff --git a/src/mine.rs b/src/mine.rs index 665c2bc..d5dfe2a 100644 --- a/src/mine.rs +++ b/src/mine.rs @@ -116,14 +116,19 @@ impl Miner { } break; } - Err(_err) => { + Err(err) => { // TODO + // MI + println!("Failure: {:?}", err); } } } } } + // TODO + // In extreme case, all running miners could be stuck in loop and waiting forever + // Temp solution: some miner exit (ctrl-c) and start over mining async fn find_bus_id(&self, reward_rate: u64) -> Bus { let mut rng = rand::thread_rng(); loop { diff --git a/src/send_and_confirm.rs b/src/send_and_confirm.rs index 03cc580..f684606 100644 --- a/src/send_and_confirm.rs +++ b/src/send_and_confirm.rs @@ -154,7 +154,16 @@ impl Miner { std::thread::sleep(Duration::from_millis( GATEWAY_DELAY, )); - return Ok(sig); + // MI + // return Ok(sig); + if signature_status.status.is_ok() && signature_status.err.is_none() { + return Ok(sig); + } else { + return Err(ClientError { + request: None, + kind: ClientErrorKind::Custom("Transaction landed with error".into()), + }); + } } } } else {