Skip to content

Commit f223d2a

Browse files
committed
Loosen background-persister so bindings are happy
1 parent feeb893 commit f223d2a

File tree

1 file changed

+23
-18
lines changed
  • background-processor/src

1 file changed

+23
-18
lines changed

background-processor/src/lib.rs

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
2020
use std::thread;
2121
use std::thread::JoinHandle;
2222
use std::time::{Duration, Instant};
23+
use std::ops::Deref;
2324

2425
/// BackgroundProcessor takes care of tasks that (1) need to happen periodically to keep
2526
/// Rust-Lightning running properly, and (2) either can or should be run in the background. Its
@@ -66,25 +67,29 @@ impl BackgroundProcessor {
6667
/// [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager
6768
/// [`ChannelManager::write`]: lightning::ln::channelmanager::ChannelManager#impl-Writeable
6869
/// [`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
7584
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>,
8893
{
8994
let stop_thread = Arc::new(AtomicBool::new(false));
9095
let stop_thread_clone = stop_thread.clone();

0 commit comments

Comments
 (0)