File tree Expand file tree Collapse file tree 2 files changed +3
-31
lines changed
Expand file tree Collapse file tree 2 files changed +3
-31
lines changed Original file line number Diff line number Diff line change @@ -373,34 +373,6 @@ impl ConnectionManager {
373373 None
374374 }
375375
376- /// Look up a PeerKeyLocation by socket address from connections_by_location or transient connections.
377- /// Used for connection-based routing when we need full peer info from just an address.
378- pub fn get_peer_location_by_addr ( & self , addr : SocketAddr ) -> Option < PeerKeyLocation > {
379- // Check connections by location
380- let connections = self . connections_by_location . read ( ) ;
381- for conns in connections. values ( ) {
382- for conn in conns {
383- if conn. location . addr ( ) == addr {
384- return Some ( conn. location . clone ( ) ) ;
385- }
386- }
387- }
388- drop ( connections) ;
389-
390- // Check transient connections - construct PeerKeyLocation from PeerId
391- if let Some ( ( peer, entry) ) = self
392- . transient_connections
393- . iter ( )
394- . find ( |e| e. key ( ) . addr == addr)
395- . map ( |e| ( e. key ( ) . clone ( ) , e. value ( ) . clone ( ) ) )
396- {
397- let mut pkl = PeerKeyLocation :: new ( peer. pub_key , peer. addr ) ;
398- pkl. location = entry. location ;
399- return Some ( pkl) ;
400- }
401- None
402- }
403-
404376 pub fn is_gateway ( & self ) -> bool {
405377 self . is_gateway
406378 }
Original file line number Diff line number Diff line change @@ -355,7 +355,7 @@ impl Ring {
355355
356356 pub async fn prune_connection ( & self , peer : PeerId ) {
357357 tracing:: debug!( %peer, "Removing connection" ) ;
358- self . live_tx_tracker . prune_transactions_from_peer ( & peer) ;
358+ self . live_tx_tracker . prune_transactions_from_peer ( peer. addr ) ;
359359 // This case would be when a connection is being open, so peer location hasn't been recorded yet and we can ignore everything below
360360 let Some ( loc) = self . connection_manager . prune_alive_connection ( & peer) else {
361361 return ;
@@ -473,7 +473,7 @@ impl Ring {
473473 . map ( |( loc, conns) | {
474474 let conns: Vec < _ > = conns
475475 . iter ( )
476- . filter ( |conn| !live_tx_tracker. has_live_connection ( & conn. location . peer ( ) ) )
476+ . filter ( |conn| !live_tx_tracker. has_live_connection ( conn. location . addr ( ) ) )
477477 . cloned ( )
478478 . collect ( ) ;
479479 ( * loc, conns)
@@ -653,7 +653,7 @@ impl Ring {
653653 op_manager. connect_forward_estimator . clone ( ) ,
654654 ) ;
655655
656- live_tx_tracker. add_transaction ( query_target. peer ( ) . clone ( ) , tx) ;
656+ live_tx_tracker. add_transaction ( query_target. addr ( ) , tx) ;
657657 op_manager
658658 . push ( tx, OpEnum :: Connect ( Box :: new ( op) ) )
659659 . await
You can’t perform that action at this time.
0 commit comments