@@ -953,7 +953,7 @@ impl Node {
953953 ///
954954 /// Will also remove the peer from the peer store, i.e., after this has been called we won't
955955 /// try to reconnect on restart.
956- pub fn disconnect ( & self , counterparty_node_id : & PublicKey ) -> Result < ( ) , Error > {
956+ pub fn disconnect ( & self , counterparty_node_id : PublicKey ) -> Result < ( ) , Error > {
957957 let rt_lock = self . runtime . read ( ) . unwrap ( ) ;
958958 if rt_lock. is_none ( ) {
959959 return Err ( Error :: NotRunning ) ;
@@ -968,7 +968,7 @@ impl Node {
968968 }
969969 }
970970
971- self . peer_manager . disconnect_by_node_id ( * counterparty_node_id) ;
971+ self . peer_manager . disconnect_by_node_id ( counterparty_node_id) ;
972972 Ok ( ( ) )
973973 }
974974
@@ -1126,10 +1126,10 @@ impl Node {
11261126
11271127 /// Close a previously opened channel.
11281128 pub fn close_channel (
1129- & self , channel_id : & ChannelId , counterparty_node_id : & PublicKey ,
1129+ & self , channel_id : & ChannelId , counterparty_node_id : PublicKey ,
11301130 ) -> Result < ( ) , Error > {
1131- self . peer_store . remove_peer ( counterparty_node_id) ?;
1132- match self . channel_manager . close_channel ( & channel_id. 0 , counterparty_node_id) {
1131+ self . peer_store . remove_peer ( & counterparty_node_id) ?;
1132+ match self . channel_manager . close_channel ( & channel_id. 0 , & counterparty_node_id) {
11331133 Ok ( _) => Ok ( ( ) ) ,
11341134 Err ( _) => Err ( Error :: ChannelClosingFailed ) ,
11351135 }
@@ -1291,7 +1291,7 @@ impl Node {
12911291
12921292 /// Send a spontaneous, aka. "keysend", payment
12931293 pub fn send_spontaneous_payment (
1294- & self , amount_msat : u64 , node_id : & PublicKey ,
1294+ & self , amount_msat : u64 , node_id : PublicKey ,
12951295 ) -> Result < PaymentHash , Error > {
12961296 let rt_lock = self . runtime . read ( ) . unwrap ( ) ;
12971297 if rt_lock. is_none ( ) {
@@ -1303,7 +1303,7 @@ impl Node {
13031303
13041304 let route_params = RouteParameters {
13051305 payment_params : PaymentParameters :: from_node_id (
1306- * node_id,
1306+ node_id,
13071307 self . config . default_cltv_expiry_delta ,
13081308 ) ,
13091309 final_value_msat : amount_msat,
@@ -1440,6 +1440,12 @@ impl Node {
14401440 }
14411441}
14421442
1443+ impl Drop for Node {
1444+ fn drop ( & mut self ) {
1445+ let _ = self . stop ( ) ;
1446+ }
1447+ }
1448+
14431449async fn connect_peer_if_necessary (
14441450 pubkey : PublicKey , peer_addr : SocketAddr , peer_manager : Arc < PeerManager > ,
14451451 logger : Arc < FilesystemLogger > ,
0 commit comments