@@ -29,6 +29,8 @@ use lightning::events::{Event, PathFailure};
29
29
use lightning:: events:: EventHandler ;
30
30
#[ cfg( feature = "std" ) ]
31
31
use lightning:: events:: EventsProvider ;
32
+ #[ cfg( feature = "futures" ) ]
33
+ use lightning:: events:: ReplayEvent ;
32
34
33
35
use lightning:: ln:: channelmanager:: AChannelManager ;
34
36
use lightning:: ln:: msgs:: OnionMessageHandler ;
@@ -539,6 +541,7 @@ use core::task;
539
541
/// could setup `process_events_async` like this:
540
542
/// ```
541
543
/// # use lightning::io;
544
+ /// # use lightning::events::ReplayEvent;
542
545
/// # use std::sync::{Arc, RwLock};
543
546
/// # use std::sync::atomic::{AtomicBool, Ordering};
544
547
/// # use std::time::SystemTime;
@@ -556,7 +559,7 @@ use core::task;
556
559
/// # }
557
560
/// # struct EventHandler {}
558
561
/// # impl EventHandler {
559
- /// # async fn handle_event(&self, _: lightning::events::Event) -> Result<(), () > { Ok(()) }
562
+ /// # async fn handle_event(&self, _: lightning::events::Event) -> Result<(), ReplayEvent > { Ok(()) }
560
563
/// # }
561
564
/// # #[derive(Eq, PartialEq, Clone, Hash)]
562
565
/// # struct SocketDescriptor {}
@@ -654,7 +657,7 @@ pub async fn process_events_async<
654
657
G : ' static + Deref < Target = NetworkGraph < L > > + Send + Sync ,
655
658
L : ' static + Deref + Send + Sync ,
656
659
P : ' static + Deref + Send + Sync ,
657
- EventHandlerFuture : core:: future:: Future < Output = Result < ( ) , ( ) > > ,
660
+ EventHandlerFuture : core:: future:: Future < Output = Result < ( ) , ReplayEvent > > ,
658
661
EventHandler : Fn ( Event ) -> EventHandlerFuture ,
659
662
PS : ' static + Deref + Send ,
660
663
M : ' static + Deref < Target = ChainMonitor < <CM :: Target as AChannelManager >:: Signer , CF , T , F , L , P > > + Send + Sync ,
@@ -704,7 +707,7 @@ where
704
707
log_trace ! ( logger, "Persisting scorer after update" ) ;
705
708
if let Err ( e) = persister. persist_scorer ( & scorer) {
706
709
log_error ! ( logger, "Error: Failed to persist scorer, check your disk and permissions {}" , e) ;
707
- return Err ( ( ) ) ;
710
+ return Err ( ReplayEvent ( ) ) ;
708
711
}
709
712
}
710
713
}
@@ -743,7 +746,7 @@ where
743
746
744
747
#[ cfg( feature = "futures" ) ]
745
748
async fn process_onion_message_handler_events_async <
746
- EventHandlerFuture : core:: future:: Future < Output = Result < ( ) , ( ) > > ,
749
+ EventHandlerFuture : core:: future:: Future < Output = Result < ( ) , ReplayEvent > > ,
747
750
EventHandler : Fn ( Event ) -> EventHandlerFuture ,
748
751
PM : ' static + Deref + Send + Sync ,
749
752
> (
0 commit comments