@@ -20,6 +20,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
20
20
use std:: thread;
21
21
use std:: thread:: JoinHandle ;
22
22
use std:: time:: { Duration , Instant } ;
23
+ use std:: ops:: Deref ;
23
24
24
25
/// BackgroundProcessor takes care of tasks that (1) need to happen periodically to keep
25
26
/// Rust-Lightning running properly, and (2) either can or should be run in the background. Its
@@ -66,25 +67,29 @@ impl BackgroundProcessor {
66
67
/// [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
67
68
/// [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
68
69
/// [`FilesystemPersister::persist_manager`]: lightning_persister::FilesystemPersister::persist_manager
69
- pub fn start < PM , Signer , M , T , K , F , L , Descriptor : ' static + SocketDescriptor + Send , CM , RM > (
70
- persist_channel_manager : PM ,
71
- channel_manager : Arc < ChannelManager < Signer , Arc < M > , Arc < T > , Arc < K > , Arc < F > , Arc < L > > > ,
72
- peer_manager : Arc < PeerManager < Descriptor , Arc < CM > , Arc < RM > , Arc < L > > > , logger : Arc < L > ,
73
- ) -> Self
74
- where
70
+ pub fn start <
71
+ PM , Signer ,
72
+ M : ' static + Deref + Send + Sync ,
73
+ T : ' static + Deref + Send + Sync ,
74
+ K : ' static + Deref + Send + Sync ,
75
+ F : ' static + Deref + Send + Sync ,
76
+ L : ' static + Deref + Send + Sync ,
77
+ Descriptor : ' static + SocketDescriptor + Send + Sync ,
78
+ CM : ' static + Deref + Send + Sync ,
79
+ RM : ' static + Deref + Send + Sync
80
+ > (
81
+ persist_channel_manager : PM , channel_manager : Arc < ChannelManager < Signer , M , T , K , F , L > > ,
82
+ peer_manager : Arc < PeerManager < Descriptor , CM , RM , L > > , logger : L ,
83
+ ) -> Self where
75
84
Signer : ' static + Sign ,
76
- M : ' static + chain:: Watch < Signer > ,
77
- T : ' static + BroadcasterInterface ,
78
- K : ' static + KeysInterface < Signer = Signer > ,
79
- F : ' static + FeeEstimator ,
80
- L : ' static + Logger ,
81
- CM : ' static + ChannelMessageHandler ,
82
- RM : ' static + RoutingMessageHandler ,
83
- PM : ' static
84
- + Send
85
- + Fn (
86
- & ChannelManager < Signer , Arc < M > , Arc < T > , Arc < K > , Arc < F > , Arc < L > > ,
87
- ) -> Result < ( ) , std:: io:: Error > ,
85
+ M :: Target : ' static + chain:: Watch < Signer > ,
86
+ T :: Target : ' static + BroadcasterInterface ,
87
+ K :: Target : ' static + KeysInterface < Signer = Signer > ,
88
+ F :: Target : ' static + FeeEstimator ,
89
+ L :: Target : ' static + Logger ,
90
+ CM :: Target : ' static + ChannelMessageHandler ,
91
+ RM :: Target : ' static + RoutingMessageHandler ,
92
+ PM : ' static + Send + Fn ( & ChannelManager < Signer , M , T , K , F , L > ) -> Result < ( ) , std:: io:: Error > ,
88
93
{
89
94
let stop_thread = Arc :: new ( AtomicBool :: new ( false ) ) ;
90
95
let stop_thread_clone = stop_thread. clone ( ) ;
0 commit comments