From: Jeffrey Czyz Date: Thu, 19 May 2022 02:47:04 +0000 (-0500) Subject: Avoid cloning Arcs when handling each event X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=8a29eb77e4641a0ed29ca0b3d267204258b63c03;p=ldk-sample Avoid cloning Arcs when handling each event --- diff --git a/src/main.rs b/src/main.rs index edcec9b..3bdabc1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -132,10 +132,10 @@ impl fmt::Display for NodeAlias<'_> { } async fn handle_ldk_events( - channel_manager: Arc, bitcoind_client: Arc, - network_graph: Arc, keys_manager: Arc, - inbound_payments: PaymentInfoStorage, outbound_payments: PaymentInfoStorage, network: Network, - event: &Event, + channel_manager: &Arc, bitcoind_client: &BitcoindClient, + network_graph: &NetworkGraph, keys_manager: &KeysManager, + inbound_payments: &PaymentInfoStorage, outbound_payments: &PaymentInfoStorage, + network: Network, event: &Event, ) { match event { Event::FundingGenerationReady { @@ -646,12 +646,12 @@ async fn start_ldk() { let handle = tokio::runtime::Handle::current(); let event_handler = move |event: &Event| { handle.block_on(handle_ldk_events( - channel_manager_event_listener.clone(), - bitcoind_rpc.clone(), - network_graph_events.clone(), - keys_manager_listener.clone(), - inbound_pmts_for_events.clone(), - outbound_pmts_for_events.clone(), + &channel_manager_event_listener, + &bitcoind_rpc, + &network_graph_events, + &keys_manager_listener, + &inbound_pmts_for_events, + &outbound_pmts_for_events, network, event, ));