Skip to content

Commit

Permalink
always dial when using dial-peer cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi committed Oct 16, 2024
1 parent bb470d3 commit ce09dc0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions applications/minotari_node/src/commands/command/dial_peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ use anyhow::Error;
use async_trait::async_trait;
use clap::Parser;
use minotari_app_utilities::utilities::UniPeerId;
use tari_network::{identity::PeerId, NetworkingService, ToPeerId};
use tari_network::{
identity::PeerId,
swarm::dial_opts::{DialOpts, PeerCondition},
NetworkingService,
ToPeerId,
};
use tokio::task;

use super::{CommandContext, HandleCommand};
Expand All @@ -53,7 +58,10 @@ impl CommandContext {
let start = Instant::now();
println!("☎️ Dialing peer...");

match network.dial_peer(dest_peer_id).await {
match network
.dial_peer(DialOpts::peer_id(dest_peer_id).condition(PeerCondition::Always).build())
.await
{
Ok(waiter) => match waiter.await {
Ok(_) => {
println!("⚡️ Peer connected in {}ms!", start.elapsed().as_millis());
Expand Down

0 comments on commit ce09dc0

Please sign in to comment.