@@ -924,7 +924,7 @@ impl BackgroundProcessor {
924924 SC : for < ' b > WriteableScore < ' b > ,
925925 > (
926926 persister : PS , event_handler : EH , chain_monitor : M , channel_manager : CM ,
927- onion_messenger : Option < OM > , gossip_sync : GossipSync < PGS , RGS , G , UL , L > , peer_manager : PM ,
927+ onion_messenger : OM , gossip_sync : GossipSync < PGS , RGS , G , UL , L > , peer_manager : PM ,
928928 logger : L , scorer : Option < S > ,
929929 ) -> Self
930930 where
@@ -961,34 +961,27 @@ impl BackgroundProcessor {
961961 }
962962 event_handler. handle_event ( event)
963963 } ;
964+ let om_opt = Some ( & * onion_messenger) ;
964965 define_run_body ! (
965966 persister,
966967 chain_monitor,
967968 chain_monitor. process_pending_events( & event_handler) ,
968969 channel_manager,
969970 channel_manager. get_cm( ) . process_pending_events( & event_handler) ,
970- onion_messenger,
971- if let Some ( om) = & onion_messenger {
972- om. get_om( ) . process_pending_events( & event_handler)
973- } ,
971+ om_opt,
972+ onion_messenger. get_om( ) . process_pending_events( & event_handler) ,
974973 peer_manager,
975974 gossip_sync,
976975 logger,
977976 scorer,
978977 stop_thread. load( Ordering :: Acquire ) ,
979978 {
980- let sleeper = if let Some ( om ) = onion_messenger . as_ref ( ) {
979+ let sleeper =
981980 Sleeper :: from_three_futures(
982981 & channel_manager. get_cm( ) . get_event_or_persistence_needed_future( ) ,
983982 & chain_monitor. get_update_future( ) ,
984- & om. get_om( ) . get_update_future( ) ,
985- )
986- } else {
987- Sleeper :: from_two_futures(
988- & channel_manager. get_cm( ) . get_event_or_persistence_needed_future( ) ,
989- & chain_monitor. get_update_future( ) ,
990- )
991- } ;
983+ & onion_messenger. get_om( ) . get_update_future( ) ,
984+ ) ;
992985 sleeper. wait_timeout( Duration :: from_millis( 100 ) ) ;
993986 } ,
994987 |_| Instant :: now( ) ,
0 commit comments