@@ -603,15 +603,13 @@ impl Worker for TcpPortalWorker {
603
603
. map ( |l| l. their_identifier ( ) )
604
604
. ok ( ) ;
605
605
606
- if remote_packet {
607
- if their_identifier != self . their_identifier {
608
- debug ! (
609
- "identifier changed from {:?} to {:?}" ,
610
- self . their_identifier. as_ref( ) . map( |i| i. to_string( ) ) ,
611
- their_identifier. as_ref( ) . map( |i| i. to_string( ) ) ,
612
- ) ;
613
- return Err ( TransportError :: IdentifierChanged ) ?;
614
- }
606
+ if remote_packet && their_identifier != self . their_identifier {
607
+ debug ! (
608
+ "identifier changed from {:?} to {:?}" ,
609
+ self . their_identifier. as_ref( ) . map( |i| i. to_string( ) ) ,
610
+ their_identifier. as_ref( ) . map( |i| i. to_string( ) ) ,
611
+ ) ;
612
+ return Err ( TransportError :: IdentifierChanged ) ?;
615
613
}
616
614
617
615
let return_route = msg. return_route ;
@@ -787,12 +785,12 @@ impl TcpPortalWorker {
787
785
] )
788
786
. start ( & tracer) ;
789
787
790
- self . their_identifier
791
- . as_ref ( )
792
- . map ( |i| span . set_attribute ( KeyValue :: new ( "expected_identifier" , i . to_string ( ) ) ) ) ;
793
- their_identifier
794
- . as_ref ( )
795
- . map ( |i| span . set_attribute ( KeyValue :: new ( "actual_identifier" , i . to_string ( ) ) ) ) ;
788
+ if let Some ( i ) = self . their_identifier . as_ref ( ) {
789
+ span . set_attribute ( KeyValue :: new ( "expected_identifier" , i . to_string ( ) ) )
790
+ }
791
+ if let Some ( i ) = their_identifier. as_ref ( ) {
792
+ span . set_attribute ( KeyValue :: new ( "actual_identifier" , i . to_string ( ) ) )
793
+ }
796
794
Ok ( span)
797
795
}
798
796
}
0 commit comments