Skip to content

Commit 3bab5fc

Browse files
Merge 880c8d1 into d6f33f9
2 parents d6f33f9 + 880c8d1 commit 3bab5fc

6 files changed

Lines changed: 93 additions & 173 deletions

File tree

iroh/examples/0rtt.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,8 @@ async fn accept(_args: Args) -> n0_snafu::Result<()> {
144144
let Some(addr) = addrs.next().await else {
145145
snafu::whatever!("Address stream closed");
146146
};
147-
if let Some(addr) = addr {
148-
if !addr.direct_addresses.is_empty() {
149-
break addr;
150-
}
147+
if !addr.direct_addresses.is_empty() {
148+
break addr;
151149
}
152150
};
153151
println!("Listening on: {addr:?}");

iroh/examples/transfer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl EndpointArgs {
273273
let node_id = endpoint.node_id();
274274
println!("Our node id:\n\t{node_id}");
275275

276-
let node_addr = endpoint.watch_node_addr().initialized().await;
276+
let node_addr = endpoint.node_addr();
277277

278278
println!("Our direct addresses:");
279279
for addr in &node_addr.direct_addresses {

iroh/src/discovery.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,6 @@ mod tests {
641641

642642
use iroh_base::{NodeAddr, SecretKey};
643643
use n0_snafu::{Error, Result, ResultExt};
644-
use n0_watcher::Watcher as _;
645644
use quinn::{IdleTimeout, TransportConfig};
646645
use rand::{Rng, SeedableRng};
647646
use tokio_util::task::AbortOnDropHandle;
@@ -770,8 +769,6 @@ mod tests {
770769
new_endpoint(secret, disco).await
771770
};
772771
let ep1_addr = NodeAddr::new(ep1.node_id());
773-
// wait for our address to be updated and thus published at least once
774-
ep1.watch_node_addr().initialized().await;
775772
let _conn = ep2.connect(ep1_addr, TEST_ALPN).await?;
776773
Ok(())
777774
}
@@ -796,8 +793,6 @@ mod tests {
796793
new_endpoint(secret, disco).await
797794
};
798795
let ep1_addr = NodeAddr::new(ep1.node_id());
799-
// wait for our address to be updated and thus published at least once
800-
ep1.watch_node_addr().initialized().await;
801796
let _conn = ep2.connect(ep1_addr, TEST_ALPN).await?;
802797
Ok(())
803798
}
@@ -823,8 +818,7 @@ mod tests {
823818
new_endpoint(secret, disco).await
824819
};
825820
let ep1_addr = NodeAddr::new(ep1.node_id());
826-
// wait for out address to be updated and thus published at least once
827-
ep1.watch_node_addr().initialized().await;
821+
828822
let _conn = ep2
829823
.connect(ep1_addr, TEST_ALPN)
830824
.await
@@ -856,8 +850,7 @@ mod tests {
856850
disco.add(disco3);
857851
new_endpoint(secret, disco).await
858852
};
859-
// wait for out address to be updated and thus published at least once
860-
ep1.watch_node_addr().initialized().await;
853+
861854
let _conn = ep2.connect(ep1.node_id(), TEST_ALPN).await?;
862855
Ok(())
863856
}
@@ -880,8 +873,6 @@ mod tests {
880873
let disco = ConcurrentDiscovery::from_services(vec![Box::new(disco1)]);
881874
new_endpoint(secret, disco).await
882875
};
883-
// wait for out address to be updated and thus published at least once
884-
ep1.watch_node_addr().initialized().await;
885876

886877
// 10x faster test via a 3s idle timeout instead of the 30s default
887878
let mut config = TransportConfig::default();
@@ -915,8 +906,7 @@ mod tests {
915906
let disco = disco_shared.create_discovery(secret.public());
916907
new_endpoint(secret, disco).await
917908
};
918-
// wait for out address to be updated and thus published at least once
919-
ep1.watch_node_addr().initialized().await;
909+
920910
let ep1_wrong_addr = NodeAddr {
921911
node_id: ep1.node_id(),
922912
relay_url: None,

0 commit comments

Comments
 (0)