Skip to content

Commit

Permalink
native websocket connect improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
aspect committed Jul 17, 2023
1 parent 4ab3ae5 commit 3bc63aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,17 @@ impl KaspaCli {
..
} => {

tprintln!(this, "Connected to Kaspa node version {server_version} at {url}\n");
tprintln!(this, "Connected to Kaspa node version {server_version} at {url}");


let is_open = this.wallet.is_open().unwrap_or_else(|err| { terrorln!(this, "Unable to check if wallet is open: {err}"); false });

if !is_synced {
if is_open {
terrorln!(this, "Error: Unable to sync wallet - Kaspa node is not synced...");
terrorln!(this, "Error: Unable to update the wallet state - Kaspa node is currently syncing with the network...");

} else {
terrorln!(this, "Error: Kaspa node is not synced...");
terrorln!(this, "Error: Kaspa node is currently syncing with the network, please wait for the sync to complete...");
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion cli/src/modules/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ impl Connect {
let url = ctx.wallet().rpc_client().parse_url(url, network_type).map_err(|e| e.to_string())?;
// tprintln!("Connecting to {}...", url.clone().unwrap_or_else(|| "default".to_string()));

let options = ConnectOptions { block_async_connect: true, strategy: ConnectStrategy::Fallback, url };
let options = ConnectOptions { block_async_connect: true, strategy: ConnectStrategy::Fallback, url, timeout: None };
ctx.wallet().rpc_client().connect(options).await.map_err(|e| e.to_string())?;
Ok(())
}
Expand Down

0 comments on commit 3bc63aa

Please sign in to comment.