@@ -35,7 +35,7 @@ use std::time::{Duration, Instant};
35
35
use std:: ops:: Deref ;
36
36
37
37
#[ cfg( feature = "futures" ) ]
38
- use futures :: { select , future:: FutureExt } ;
38
+ use futures_util :: { select_biased , future:: FutureExt } ;
39
39
40
40
/// `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
41
41
/// Rust-Lightning running properly, and (2) either can or should be run in the background. Its
@@ -378,14 +378,15 @@ pub async fn process_events_async<
378
378
Descriptor : ' static + SocketDescriptor + Send + Sync ,
379
379
CMH : ' static + Deref + Send + Sync ,
380
380
RMH : ' static + Deref + Send + Sync ,
381
+ OMH : ' static + Deref + Send + Sync ,
381
382
EH : ' static + EventHandler + Send ,
382
383
PS : ' static + Deref + Send ,
383
384
M : ' static + Deref < Target = ChainMonitor < Signer , CF , T , F , L , P > > + Send + Sync ,
384
385
CM : ' static + Deref < Target = ChannelManager < Signer , CW , T , K , F , L > > + Send + Sync ,
385
386
PGS : ' static + Deref < Target = P2PGossipSync < G , CA , L > > + Send + Sync ,
386
387
RGS : ' static + Deref < Target = RapidGossipSync < G , L > > + Send ,
387
388
UMH : ' static + Deref + Send + Sync ,
388
- PM : ' static + Deref < Target = PeerManager < Descriptor , CMH , RMH , L , UMH > > + Send + Sync ,
389
+ PM : ' static + Deref < Target = PeerManager < Descriptor , CMH , RMH , OMH , L , UMH > > + Send + Sync ,
389
390
S : ' static + Deref < Target = SC > + Send + Sync ,
390
391
SC : WriteableScore < ' a > ,
391
392
SleepFuture : core:: future:: Future < Output = bool > ,
@@ -405,14 +406,15 @@ where
405
406
L :: Target : ' static + Logger ,
406
407
P :: Target : ' static + Persist < Signer > ,
407
408
CMH :: Target : ' static + ChannelMessageHandler ,
409
+ OMH :: Target : ' static + OnionMessageHandler ,
408
410
RMH :: Target : ' static + RoutingMessageHandler ,
409
411
UMH :: Target : ' static + CustomMessageHandler ,
410
412
PS :: Target : ' static + Persister < ' a , Signer , CW , T , K , F , L , SC > ,
411
413
{
412
414
let mut should_continue = true ;
413
415
define_run_body ! ( persister, event_handler, chain_monitor, channel_manager,
414
416
gossip_sync, peer_manager, logger, scorer, should_continue, {
415
- select ! {
417
+ select_biased ! {
416
418
_ = channel_manager. get_persistable_update_future( ) . fuse( ) => true ,
417
419
cont = sleeper( Duration :: from_millis( 100 ) ) . fuse( ) => {
418
420
should_continue = cont;
0 commit comments