discovery: the receiver registers its announce type

This commit is contained in:
DeFiDude committed 2026-11-18 13:05:37 -07:00
1 parent 80b64223dc
commit 03b6f411ad
2 files changed
+26

No files matched your search

+6
View File
@@ -7701,6 +7701,12 @@ async fn start_on_network_discovery(handle: ReticulumHandle) {
if !*started {
*started = true;
drop(started);
// InterfaceDiscovery registers its announce type (Discovery.py).
handle
.wants_destination_type(
rns_transport::discovery::constants::DISCOVERY_ASPECT_FILTER,
)
.await;
let (observer_tx, observer_rx) = if handle.config.autoconnect_discovered_interfaces > 0
{
@@ -172,3 +172,23 @@ fn blocked_ips_lines_parse_like_upstream() {
.collect();
assert_eq!(parsed, ["198.51.100.7", "2001:db8::1", "::1"]);
}
/// Discovery.py 1.6.1 (884f109b): the receiver wants its announce type, so
/// `required_only` does not drop discovery announces.
#[tokio::test]
async fn interface_discovery_registers_its_announce_type() {
let (mut handle, _actor) = discovery_actor();
let dir = tempfile::tempdir().unwrap();
handle
.install_discovery_store_for_tests(Arc::new(DiscoveryStore::open(dir.path()).unwrap()))
.await;
handle.config.discover_interfaces = true;
handle
.enable_on_network_discovery(Arc::new(StaticStamper))
.await;
assert!(
handle
.unwants_destination_type(rns_transport::discovery::constants::DISCOVERY_ASPECT_FILTER)
.await
);
}