@@ -583,14 +583,12 @@ pub(crate) mod futures_util {
583
583
C : Future < Output = ( ) > + Unpin ,
584
584
D : Future < Output = ( ) > + Unpin ,
585
585
E : Future < Output = bool > + Unpin ,
586
- F : Future < Output = bool > + Unpin ,
587
586
> {
588
587
pub a : A ,
589
588
pub b : B ,
590
589
pub c : C ,
591
590
pub d : D ,
592
591
pub e : E ,
593
- pub f : F ,
594
592
}
595
593
596
594
pub ( crate ) enum SelectorOutput {
@@ -599,7 +597,6 @@ pub(crate) mod futures_util {
599
597
C ,
600
598
D ,
601
599
E ( bool ) ,
602
- F ( bool ) ,
603
600
}
604
601
605
602
impl <
@@ -608,8 +605,7 @@ pub(crate) mod futures_util {
608
605
C : Future < Output = ( ) > + Unpin ,
609
606
D : Future < Output = ( ) > + Unpin ,
610
607
E : Future < Output = bool > + Unpin ,
611
- F : Future < Output = bool > + Unpin ,
612
- > Future for Selector < A , B , C , D , E , F >
608
+ > Future for Selector < A , B , C , D , E >
613
609
{
614
610
type Output = SelectorOutput ;
615
611
fn poll (
@@ -645,12 +641,6 @@ pub(crate) mod futures_util {
645
641
} ,
646
642
Poll :: Pending => { } ,
647
643
}
648
- match Pin :: new ( & mut self . f ) . poll ( ctx) {
649
- Poll :: Ready ( res) => {
650
- return Poll :: Ready ( SelectorOutput :: F ( res) ) ;
651
- } ,
652
- Poll :: Pending => { } ,
653
- }
654
644
Poll :: Pending
655
645
}
656
646
}
@@ -990,30 +980,27 @@ where
990
980
} else {
991
981
OptionalSelector { optional_future: None }
992
982
} ;
983
+
984
+ let needs_processing = channel_manager. get_cm( ) . needs_pending_htlc_processing( ) ;
985
+ let sleep_delay = match ( needs_processing, mobile_interruptable_platform) {
986
+ ( true , true ) => batch_delay. get( ) . min( Duration :: from_millis( 100 ) ) ,
987
+ ( true , false ) => batch_delay. get( ) . min( FASTEST_TIMER ) ,
988
+ ( false , true ) => Duration :: from_millis( 100 ) ,
989
+ ( false , false ) => FASTEST_TIMER ,
990
+ } ;
991
+
993
992
let fut = Selector {
994
993
a: channel_manager. get_cm( ) . get_event_or_persistence_needed_future( ) ,
995
994
b: chain_monitor. get_update_future( ) ,
996
995
c: om_fut,
997
996
d: lm_fut,
998
- e: sleeper( if channel_manager. get_cm( ) . needs_pending_htlc_processing( ) {
999
- batch_delay. get( )
1000
- } else {
1001
- Duration :: MAX
1002
- } ) ,
1003
- f: sleeper( if mobile_interruptable_platform {
1004
- Duration :: from_millis( 100 )
1005
- } else {
1006
- FASTEST_TIMER
1007
- } ) ,
997
+ e: sleeper( sleep_delay) ,
1008
998
} ;
1009
999
match fut. await {
1010
1000
SelectorOutput :: A | SelectorOutput :: B | SelectorOutput :: C | SelectorOutput :: D => { } ,
1011
1001
SelectorOutput :: E ( exit) => {
1012
1002
should_break = exit;
1013
1003
} ,
1014
- SelectorOutput :: F ( exit) => {
1015
- should_break = exit;
1016
- } ,
1017
1004
}
1018
1005
} ,
1019
1006
|t| sleeper( t) ,
0 commit comments