retry if the connection is broken

This commit is contained in:
DenioD
2020-07-26 11:57:08 +02:00
parent 724ea09cfc
commit b23a311599
3 changed files with 66 additions and 18 deletions

View File

@@ -146,8 +146,8 @@ pub fn start_interactive(command_tx: Sender<(String, Vec<String>)>, resp_rx: Rec
}
};
let info = &send_command("info".to_string(), vec![]);
let chain_name = json::parse(info).unwrap()["chain_name"].as_str().unwrap().to_string();
let info = send_command("info".to_string(), vec![]);
let chain_name = json::parse(&info).unwrap()["chain_name"].as_str().unwrap().to_string();
loop {
// Read the height first