From 6638c80c55df1e1f87ea2f54186ae94f2ed65f53 Mon Sep 17 00:00:00 2001 From: DeFiDude <59237470+DeFiDude@users.noreply.github.com> Date: Sat, 13 Jun 2026 19:56:20 -0600 Subject: [PATCH] transport: skip path requests for outbound proofs --- crates/rns-transport/src/actor/mod.rs | 22 ++++++++++++++++++++++ crates/rns-transport/src/actor/outbound.rs | 4 +++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/crates/rns-transport/src/actor/mod.rs b/crates/rns-transport/src/actor/mod.rs index 401595f..3973969 100644 --- a/crates/rns-transport/src/actor/mod.rs +++ b/crates/rns-transport/src/actor/mod.rs @@ -3047,6 +3047,28 @@ mod tests { assert!(rx2.try_recv().is_ok()); } + #[test] + fn outbound_no_path_proof_does_not_request_path() { + let (mut actor, _tx) = TransportActor::new(); + let (entry, mut rx) = make_test_interface("iface1"); + actor.interfaces.insert(1, entry); + + let dest_hash = [0x42; 16]; + let raw = make_proof_packet(dest_hash, 0); + actor.on_outbound(OutboundRequest { + raw: raw.clone(), + destination_hash: dest_hash, + }); + + let sent = rx.try_recv().expect("proof should broadcast"); + assert_eq!(sent, raw); + assert!( + rx.try_recv().is_err(), + "proof should not be followed by a path request" + ); + assert!(!actor.path_requests.contains_key(&dest_hash)); + } + fn assert_link_request_pins_to_path_owner( owner_name: &str, owner_mode: InterfaceMode, diff --git a/crates/rns-transport/src/actor/outbound.rs b/crates/rns-transport/src/actor/outbound.rs index f2aa818..875e66f 100644 --- a/crates/rns-transport/src/actor/outbound.rs +++ b/crates/rns-transport/src/actor/outbound.rs @@ -129,7 +129,9 @@ impl TransportActor { "outbound: no path, broadcasting" ); self.broadcast_on_interfaces(&request.raw, None); - self.on_automatic_path_request(request.destination_hash); + if parsed.flags.packet_type != rns_wire::flags::PacketType::Proof { + self.on_automatic_path_request(request.destination_hash); + } } } }