@@ -752,14 +752,17 @@ impl Node {
752
752
let Some ( accepted_handle) =
753
753
self . accepted_connections . remove ( & accepted_addr) else
754
754
{
755
- error ! (
755
+ warn ! (
756
756
self . log,
757
- "Missing AcceptedConnHandle" ;
757
+ concat!(
758
+ "Missing AcceptedConnHandle: " ,
759
+ "Stale ConnectedAcceptor msg"
760
+ ) ;
758
761
"accepted_addr" => accepted_addr. to_string( ) ,
759
762
"addr" => addr. to_string( ) ,
760
763
"remote_peer_id" => peer_id. to_string( )
761
764
) ;
762
- panic ! ( "Missing AcceptedConnHandle" ) ;
765
+ return ;
763
766
} ;
764
767
765
768
// Ignore the stale message if the unique_id doesn't match what
@@ -818,13 +821,13 @@ impl Node {
818
821
self . established_connections
819
822
. insert ( peer_id. clone ( ) , handle) ;
820
823
} else {
821
- error ! (
824
+ warn ! (
822
825
self . log,
823
- "Missing PeerConnHandle" ;
826
+ "Missing PeerConnHandle; Stale ConnectedInitiator msg " ;
824
827
"addr" => addr. to_string( ) ,
825
828
"remote_peer_id" => peer_id. to_string( )
826
829
) ;
827
- panic ! ( "Missing PeerConnHandle" ) ;
830
+ return ;
828
831
}
829
832
830
833
if let Err ( e) =
@@ -846,12 +849,12 @@ impl Node {
846
849
return ;
847
850
}
848
851
} else {
849
- error ! (
852
+ warn ! (
850
853
self . log,
851
- "Missing PeerConnHandle" ;
854
+ "Missing PeerConnHandle: Stale Disconnected msg " ;
852
855
"remote_peer_id" => peer_id. to_string( )
853
856
) ;
854
- panic ! ( "Missing PeerConnHandle" ) ;
857
+ return ;
855
858
}
856
859
warn ! ( self . log, "peer disconnected {peer_id}" ) ;
857
860
let handle =
@@ -932,6 +935,7 @@ impl Node {
932
935
self . conn_tx . clone ( ) ,
933
936
)
934
937
. await ;
938
+ info ! ( self . log, "Initiating connection to new peer: {addr}" ) ;
935
939
self . initiating_connections . insert ( addr, handle) ;
936
940
}
937
941
}
@@ -952,6 +956,11 @@ impl Node {
952
956
async fn remove_peer ( & mut self , addr : SocketAddrV6 ) {
953
957
if let Some ( handle) = self . initiating_connections . remove ( & addr) {
954
958
// The connection has not yet completed its handshake
959
+ info ! (
960
+ self . log,
961
+ "Peer removed: deleting initiating connection" ;
962
+ "remote_addr" => addr. to_string( )
963
+ ) ;
955
964
let _ = handle. tx . send ( MainToConnMsg :: Close ) . await ;
956
965
} else {
957
966
// Do we have an established connection?
@@ -960,6 +969,12 @@ impl Node {
960
969
. iter ( )
961
970
. find ( |( _, handle) | handle. addr == addr)
962
971
{
972
+ info ! (
973
+ self . log,
974
+ "Peer removed: deleting established connection" ;
975
+ "remote_addr" => addr. to_string( ) ,
976
+ "remote_peer_id" => id. to_string( ) ,
977
+ ) ;
963
978
let _ = handle. tx . send ( MainToConnMsg :: Close ) . await ;
964
979
// probably a better way to avoid borrowck issues
965
980
let id = id. clone ( ) ;
0 commit comments