@@ -36,8 +36,10 @@ use lightning::onion_message::messenger::AOnionMessenger;
36
36
use lightning:: routing:: gossip:: { NetworkGraph , P2PGossipSync } ;
37
37
use lightning:: routing:: scoring:: { ScoreUpdate , WriteableScore } ;
38
38
use lightning:: routing:: utxo:: UtxoLookup ;
39
+ use lightning:: sign:: { ChangeDestinationSource , OutputSpender } ;
39
40
use lightning:: util:: logger:: Logger ;
40
- use lightning:: util:: persist:: Persister ;
41
+ use lightning:: util:: persist:: { KVStore , Persister } ;
42
+ use lightning:: util:: sweep:: OutputSweeper ;
41
43
#[ cfg( feature = "std" ) ]
42
44
use lightning:: util:: wakers:: Sleeper ;
43
45
use lightning_rapid_gossip_sync:: RapidGossipSync ;
@@ -132,6 +134,11 @@ const REBROADCAST_TIMER: u64 = 30;
132
134
#[ cfg( test) ]
133
135
const REBROADCAST_TIMER : u64 = 1 ;
134
136
137
+ #[ cfg( not( test) ) ]
138
+ const SWEEPER_TIMER : u64 = 30 ;
139
+ #[ cfg( test) ]
140
+ const SWEEPER_TIMER : u64 = 1 ;
141
+
135
142
#[ cfg( feature = "futures" ) ]
136
143
/// core::cmp::min is not currently const, so we define a trivial (and equivalent) replacement
137
144
const fn min_u64 ( a : u64 , b : u64 ) -> u64 {
@@ -308,6 +315,7 @@ macro_rules! define_run_body {
308
315
$channel_manager: ident, $process_channel_manager_events: expr,
309
316
$onion_messenger: ident, $process_onion_message_handler_events: expr,
310
317
$peer_manager: ident, $gossip_sync: ident,
318
+ $process_sweeper: expr,
311
319
$logger: ident, $scorer: ident, $loop_exit_check: expr, $await: expr, $get_timer: expr,
312
320
$timer_elapsed: expr, $check_slow_await: expr, $time_fetch: expr,
313
321
) => { {
@@ -322,6 +330,7 @@ macro_rules! define_run_body {
322
330
let mut last_prune_call = $get_timer( FIRST_NETWORK_PRUNE_TIMER ) ;
323
331
let mut last_scorer_persist_call = $get_timer( SCORER_PERSIST_TIMER ) ;
324
332
let mut last_rebroadcast_call = $get_timer( REBROADCAST_TIMER ) ;
333
+ let mut last_sweeper_call = $get_timer( SWEEPER_TIMER ) ;
325
334
let mut have_pruned = false ;
326
335
let mut have_decayed_scorer = false ;
327
336
@@ -465,6 +474,12 @@ macro_rules! define_run_body {
465
474
$chain_monitor. rebroadcast_pending_claims( ) ;
466
475
last_rebroadcast_call = $get_timer( REBROADCAST_TIMER ) ;
467
476
}
477
+
478
+ if $timer_elapsed( & mut last_sweeper_call, SWEEPER_TIMER ) {
479
+ log_trace!( $logger, "Regenerating sweeper spends if necessary" ) ;
480
+ let _ = $process_sweeper;
481
+ last_sweeper_call = $get_timer( SWEEPER_TIMER ) ;
482
+ }
468
483
}
469
484
470
485
// After we exit, ensure we persist the ChannelManager one final time - this avoids
@@ -627,6 +642,7 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
627
642
/// ```
628
643
/// # use lightning::io;
629
644
/// # use lightning::events::ReplayEvent;
645
+ /// # use lightning::util::sweep::OutputSweeper;
630
646
/// # use std::sync::{Arc, RwLock};
631
647
/// # use std::sync::atomic::{AtomicBool, Ordering};
632
648
/// # use std::time::SystemTime;
@@ -666,6 +682,9 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
666
682
/// # F: lightning::chain::Filter + Send + Sync + 'static,
667
683
/// # FE: lightning::chain::chaininterface::FeeEstimator + Send + Sync + 'static,
668
684
/// # UL: lightning::routing::utxo::UtxoLookup + Send + Sync + 'static,
685
+ /// # D: lightning::sign::ChangeDestinationSource + Send + Sync + 'static,
686
+ /// # K: lightning::util::persist::KVStore + Send + Sync + 'static,
687
+ /// # O: lightning::sign::OutputSpender + Send + Sync + 'static,
669
688
/// # > {
670
689
/// # peer_manager: Arc<PeerManager<B, F, FE, UL>>,
671
690
/// # event_handler: Arc<EventHandler>,
@@ -677,14 +696,18 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
677
696
/// # persister: Arc<Store>,
678
697
/// # logger: Arc<Logger>,
679
698
/// # scorer: Arc<Scorer>,
699
+ /// # sweeper: Arc<OutputSweeper<Arc<B>, Arc<D>, Arc<FE>, Arc<F>, Arc<K>, Arc<Logger>, Arc<O>>>,
680
700
/// # }
681
701
/// #
682
702
/// # async fn setup_background_processing<
683
703
/// # B: lightning::chain::chaininterface::BroadcasterInterface + Send + Sync + 'static,
684
704
/// # F: lightning::chain::Filter + Send + Sync + 'static,
685
705
/// # FE: lightning::chain::chaininterface::FeeEstimator + Send + Sync + 'static,
686
706
/// # UL: lightning::routing::utxo::UtxoLookup + Send + Sync + 'static,
687
- /// # >(node: Node<B, F, FE, UL>) {
707
+ /// # D: lightning::sign::ChangeDestinationSource + Send + Sync + 'static,
708
+ /// # K: lightning::util::persist::KVStore + Send + Sync + 'static,
709
+ /// # O: lightning::sign::OutputSpender + Send + Sync + 'static,
710
+ /// # >(node: Node<B, F, FE, UL, D, K, O>) {
688
711
/// let background_persister = Arc::clone(&node.persister);
689
712
/// let background_event_handler = Arc::clone(&node.event_handler);
690
713
/// let background_chain_mon = Arc::clone(&node.chain_monitor);
@@ -695,7 +718,8 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
695
718
/// let background_liquidity_manager = Arc::clone(&node.liquidity_manager);
696
719
/// let background_logger = Arc::clone(&node.logger);
697
720
/// let background_scorer = Arc::clone(&node.scorer);
698
- ///
721
+ /// let background_sweeper = Arc::clone(&node.sweeper);
722
+
699
723
/// // Setup the sleeper.
700
724
#[ cfg_attr(
701
725
feature = "std" ,
@@ -729,6 +753,7 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
729
753
/// background_gossip_sync,
730
754
/// background_peer_man,
731
755
/// Some(background_liquidity_manager),
756
+ /// Some(background_sweeper),
732
757
/// background_logger,
733
758
/// Some(background_scorer),
734
759
/// sleeper,
@@ -767,6 +792,10 @@ pub async fn process_events_async<
767
792
RGS : ' static + Deref < Target = RapidGossipSync < G , L > > ,
768
793
PM : ' static + Deref ,
769
794
LM : ' static + Deref ,
795
+ D : ' static + Deref ,
796
+ O : ' static + Deref ,
797
+ K : ' static + Deref ,
798
+ OS : ' static + Deref < Target = OutputSweeper < T , D , F , CF , K , L , O > > ,
770
799
S : ' static + Deref < Target = SC > + Send + Sync ,
771
800
SC : for < ' b > WriteableScore < ' b > ,
772
801
SleepFuture : core:: future:: Future < Output = bool > + core:: marker:: Unpin ,
@@ -775,12 +804,12 @@ pub async fn process_events_async<
775
804
> (
776
805
persister : PS , event_handler : EventHandler , chain_monitor : M , channel_manager : CM ,
777
806
onion_messenger : Option < OM > , gossip_sync : GossipSync < PGS , RGS , G , UL , L > , peer_manager : PM ,
778
- liquidity_manager : Option < LM > , logger : L , scorer : Option < S > , sleeper : Sleeper ,
779
- mobile_interruptable_platform : bool , fetch_time : FetchTime ,
807
+ liquidity_manager : Option < LM > , sweeper : Option < OS > , logger : L , scorer : Option < S > ,
808
+ sleeper : Sleeper , mobile_interruptable_platform : bool , fetch_time : FetchTime ,
780
809
) -> Result < ( ) , lightning:: io:: Error >
781
810
where
782
811
UL :: Target : ' static + UtxoLookup ,
783
- CF :: Target : ' static + chain:: Filter ,
812
+ CF :: Target : ' static + chain:: Filter + Sync + Send ,
784
813
T :: Target : ' static + BroadcasterInterface ,
785
814
F :: Target : ' static + FeeEstimator ,
786
815
L :: Target : ' static + Logger ,
@@ -790,6 +819,9 @@ where
790
819
OM :: Target : AOnionMessenger ,
791
820
PM :: Target : APeerManager ,
792
821
LM :: Target : ALiquidityManager ,
822
+ O :: Target : ' static + OutputSpender ,
823
+ D :: Target : ' static + ChangeDestinationSource ,
824
+ K :: Target : ' static + KVStore ,
793
825
{
794
826
let mut should_break = false ;
795
827
let async_event_handler = |event| {
@@ -833,6 +865,13 @@ where
833
865
} ,
834
866
peer_manager,
835
867
gossip_sync,
868
+ {
869
+ if let Some ( ref sweeper) = sweeper {
870
+ sweeper. regenerate_and_broadcast_spend_if_necessary( )
871
+ } else {
872
+ Ok ( ( ) )
873
+ }
874
+ } ,
836
875
logger,
837
876
scorer,
838
877
should_break,
@@ -953,14 +992,18 @@ impl BackgroundProcessor {
953
992
LM : ' static + Deref + Send ,
954
993
S : ' static + Deref < Target = SC > + Send + Sync ,
955
994
SC : for < ' b > WriteableScore < ' b > ,
995
+ D : ' static + Deref ,
996
+ O : ' static + Deref ,
997
+ K : ' static + Deref ,
998
+ OS : ' static + Deref < Target = OutputSweeper < T , D , F , CF , K , L , O > > + Send + Sync ,
956
999
> (
957
1000
persister : PS , event_handler : EH , chain_monitor : M , channel_manager : CM ,
958
1001
onion_messenger : Option < OM > , gossip_sync : GossipSync < PGS , RGS , G , UL , L > , peer_manager : PM ,
959
- liquidity_manager : Option < LM > , logger : L , scorer : Option < S > ,
1002
+ liquidity_manager : Option < LM > , sweeper : Option < OS > , logger : L , scorer : Option < S > ,
960
1003
) -> Self
961
1004
where
962
1005
UL :: Target : ' static + UtxoLookup ,
963
- CF :: Target : ' static + chain:: Filter ,
1006
+ CF :: Target : ' static + chain:: Filter + Sync + Send ,
964
1007
T :: Target : ' static + BroadcasterInterface ,
965
1008
F :: Target : ' static + FeeEstimator ,
966
1009
L :: Target : ' static + Logger ,
@@ -970,6 +1013,9 @@ impl BackgroundProcessor {
970
1013
OM :: Target : AOnionMessenger ,
971
1014
PM :: Target : APeerManager ,
972
1015
LM :: Target : ALiquidityManager ,
1016
+ O :: Target : ' static + OutputSpender ,
1017
+ D :: Target : ' static + ChangeDestinationSource ,
1018
+ K :: Target : ' static + KVStore ,
973
1019
{
974
1020
let stop_thread = Arc :: new ( AtomicBool :: new ( false ) ) ;
975
1021
let stop_thread_clone = stop_thread. clone ( ) ;
@@ -1005,6 +1051,13 @@ impl BackgroundProcessor {
1005
1051
} ,
1006
1052
peer_manager,
1007
1053
gossip_sync,
1054
+ {
1055
+ if let Some ( ref sweeper) = sweeper {
1056
+ sweeper. regenerate_and_broadcast_spend_if_necessary( )
1057
+ } else {
1058
+ Ok ( ( ) )
1059
+ }
1060
+ } ,
1008
1061
logger,
1009
1062
scorer,
1010
1063
stop_thread. load( Ordering :: Acquire ) ,
@@ -1269,7 +1322,7 @@ mod tests {
1269
1322
Arc < test_utils:: TestBroadcaster > ,
1270
1323
Arc < TestWallet > ,
1271
1324
Arc < test_utils:: TestFeeEstimator > ,
1272
- Arc < dyn Filter + Sync + Send > ,
1325
+ Arc < test_utils :: TestChainSource > ,
1273
1326
Arc < FilesystemStore > ,
1274
1327
Arc < test_utils:: TestLogger > ,
1275
1328
Arc < KeysManager > ,
@@ -1648,7 +1701,7 @@ mod tests {
1648
1701
best_block,
1649
1702
Arc :: clone ( & tx_broadcaster) ,
1650
1703
Arc :: clone ( & fee_estimator) ,
1651
- None :: < Arc < dyn Filter + Sync + Send > > ,
1704
+ None :: < Arc < test_utils :: TestChainSource > > ,
1652
1705
Arc :: clone ( & keys_manager) ,
1653
1706
wallet,
1654
1707
Arc :: clone ( & kv_store) ,
@@ -1888,6 +1941,7 @@ mod tests {
1888
1941
nodes[ 0 ] . p2p_gossip_sync ( ) ,
1889
1942
nodes[ 0 ] . peer_manager . clone ( ) ,
1890
1943
Some ( Arc :: clone ( & nodes[ 0 ] . liquidity_manager ) ) ,
1944
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
1891
1945
nodes[ 0 ] . logger . clone ( ) ,
1892
1946
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
1893
1947
) ;
@@ -1982,6 +2036,7 @@ mod tests {
1982
2036
nodes[ 0 ] . no_gossip_sync ( ) ,
1983
2037
nodes[ 0 ] . peer_manager . clone ( ) ,
1984
2038
Some ( Arc :: clone ( & nodes[ 0 ] . liquidity_manager ) ) ,
2039
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
1985
2040
nodes[ 0 ] . logger . clone ( ) ,
1986
2041
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
1987
2042
) ;
@@ -2025,6 +2080,7 @@ mod tests {
2025
2080
nodes[ 0 ] . no_gossip_sync ( ) ,
2026
2081
nodes[ 0 ] . peer_manager . clone ( ) ,
2027
2082
Some ( Arc :: clone ( & nodes[ 0 ] . liquidity_manager ) ) ,
2083
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2028
2084
nodes[ 0 ] . logger . clone ( ) ,
2029
2085
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2030
2086
) ;
@@ -2058,6 +2114,7 @@ mod tests {
2058
2114
nodes[ 0 ] . rapid_gossip_sync ( ) ,
2059
2115
nodes[ 0 ] . peer_manager . clone ( ) ,
2060
2116
Some ( Arc :: clone ( & nodes[ 0 ] . liquidity_manager ) ) ,
2117
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2061
2118
nodes[ 0 ] . logger . clone ( ) ,
2062
2119
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2063
2120
move |dur : Duration | {
@@ -2095,6 +2152,7 @@ mod tests {
2095
2152
nodes[ 0 ] . p2p_gossip_sync ( ) ,
2096
2153
nodes[ 0 ] . peer_manager . clone ( ) ,
2097
2154
Some ( Arc :: clone ( & nodes[ 0 ] . liquidity_manager ) ) ,
2155
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2098
2156
nodes[ 0 ] . logger . clone ( ) ,
2099
2157
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2100
2158
) ;
@@ -2125,6 +2183,7 @@ mod tests {
2125
2183
nodes[ 0 ] . no_gossip_sync ( ) ,
2126
2184
nodes[ 0 ] . peer_manager . clone ( ) ,
2127
2185
Some ( Arc :: clone ( & nodes[ 0 ] . liquidity_manager ) ) ,
2186
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2128
2187
nodes[ 0 ] . logger . clone ( ) ,
2129
2188
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2130
2189
) ;
@@ -2172,6 +2231,7 @@ mod tests {
2172
2231
nodes[ 0 ] . no_gossip_sync ( ) ,
2173
2232
nodes[ 0 ] . peer_manager . clone ( ) ,
2174
2233
Some ( Arc :: clone ( & nodes[ 0 ] . liquidity_manager ) ) ,
2234
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2175
2235
nodes[ 0 ] . logger . clone ( ) ,
2176
2236
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2177
2237
) ;
@@ -2235,6 +2295,7 @@ mod tests {
2235
2295
nodes[ 0 ] . no_gossip_sync ( ) ,
2236
2296
nodes[ 0 ] . peer_manager . clone ( ) ,
2237
2297
Some ( Arc :: clone ( & nodes[ 0 ] . liquidity_manager ) ) ,
2298
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2238
2299
nodes[ 0 ] . logger . clone ( ) ,
2239
2300
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2240
2301
) ;
@@ -2280,10 +2341,22 @@ mod tests {
2280
2341
2281
2342
advance_chain ( & mut nodes[ 0 ] , 3 ) ;
2282
2343
2344
+ let tx_broadcaster = nodes[ 0 ] . tx_broadcaster . clone ( ) ;
2345
+ let wait_for_sweep_tx = || -> Transaction {
2346
+ loop {
2347
+ let sweep_tx = tx_broadcaster. txn_broadcasted . lock ( ) . unwrap ( ) . pop ( ) ;
2348
+ if let Some ( sweep_tx) = sweep_tx {
2349
+ return sweep_tx;
2350
+ }
2351
+
2352
+ std:: thread:: sleep ( Duration :: from_millis ( 100 ) ) ;
2353
+ }
2354
+ } ;
2355
+
2283
2356
// Check we generate an initial sweeping tx.
2284
2357
assert_eq ! ( nodes[ 0 ] . sweeper. tracked_spendable_outputs( ) . len( ) , 1 ) ;
2358
+ let sweep_tx_0 = wait_for_sweep_tx ( ) ;
2285
2359
let tracked_output = nodes[ 0 ] . sweeper . tracked_spendable_outputs ( ) . first ( ) . unwrap ( ) . clone ( ) ;
2286
- let sweep_tx_0 = nodes[ 0 ] . tx_broadcaster . txn_broadcasted . lock ( ) . unwrap ( ) . pop ( ) . unwrap ( ) ;
2287
2360
match tracked_output. status {
2288
2361
OutputSpendStatus :: PendingFirstConfirmation { latest_spending_tx, .. } => {
2289
2362
assert_eq ! ( sweep_tx_0. compute_txid( ) , latest_spending_tx. compute_txid( ) ) ;
@@ -2294,8 +2367,8 @@ mod tests {
2294
2367
// Check we regenerate and rebroadcast the sweeping tx each block.
2295
2368
advance_chain ( & mut nodes[ 0 ] , 1 ) ;
2296
2369
assert_eq ! ( nodes[ 0 ] . sweeper. tracked_spendable_outputs( ) . len( ) , 1 ) ;
2370
+ let sweep_tx_1 = wait_for_sweep_tx ( ) ;
2297
2371
let tracked_output = nodes[ 0 ] . sweeper . tracked_spendable_outputs ( ) . first ( ) . unwrap ( ) . clone ( ) ;
2298
- let sweep_tx_1 = nodes[ 0 ] . tx_broadcaster . txn_broadcasted . lock ( ) . unwrap ( ) . pop ( ) . unwrap ( ) ;
2299
2372
match tracked_output. status {
2300
2373
OutputSpendStatus :: PendingFirstConfirmation { latest_spending_tx, .. } => {
2301
2374
assert_eq ! ( sweep_tx_1. compute_txid( ) , latest_spending_tx. compute_txid( ) ) ;
@@ -2306,8 +2379,8 @@ mod tests {
2306
2379
2307
2380
advance_chain ( & mut nodes[ 0 ] , 1 ) ;
2308
2381
assert_eq ! ( nodes[ 0 ] . sweeper. tracked_spendable_outputs( ) . len( ) , 1 ) ;
2382
+ let sweep_tx_2 = wait_for_sweep_tx ( ) ;
2309
2383
let tracked_output = nodes[ 0 ] . sweeper . tracked_spendable_outputs ( ) . first ( ) . unwrap ( ) . clone ( ) ;
2310
- let sweep_tx_2 = nodes[ 0 ] . tx_broadcaster . txn_broadcasted . lock ( ) . unwrap ( ) . pop ( ) . unwrap ( ) ;
2311
2384
match tracked_output. status {
2312
2385
OutputSpendStatus :: PendingFirstConfirmation { latest_spending_tx, .. } => {
2313
2386
assert_eq ! ( sweep_tx_2. compute_txid( ) , latest_spending_tx. compute_txid( ) ) ;
@@ -2387,6 +2460,7 @@ mod tests {
2387
2460
nodes[ 0 ] . no_gossip_sync ( ) ,
2388
2461
nodes[ 0 ] . peer_manager . clone ( ) ,
2389
2462
Some ( Arc :: clone ( & nodes[ 0 ] . liquidity_manager ) ) ,
2463
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2390
2464
nodes[ 0 ] . logger . clone ( ) ,
2391
2465
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2392
2466
) ;
@@ -2417,6 +2491,7 @@ mod tests {
2417
2491
nodes[ 0 ] . no_gossip_sync ( ) ,
2418
2492
nodes[ 0 ] . peer_manager . clone ( ) ,
2419
2493
Some ( Arc :: clone ( & nodes[ 0 ] . liquidity_manager ) ) ,
2494
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2420
2495
nodes[ 0 ] . logger . clone ( ) ,
2421
2496
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2422
2497
) ;
@@ -2513,6 +2588,7 @@ mod tests {
2513
2588
nodes[ 0 ] . rapid_gossip_sync ( ) ,
2514
2589
nodes[ 0 ] . peer_manager . clone ( ) ,
2515
2590
Some ( Arc :: clone ( & nodes[ 0 ] . liquidity_manager ) ) ,
2591
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2516
2592
nodes[ 0 ] . logger . clone ( ) ,
2517
2593
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2518
2594
) ;
@@ -2546,6 +2622,7 @@ mod tests {
2546
2622
nodes[ 0 ] . rapid_gossip_sync ( ) ,
2547
2623
nodes[ 0 ] . peer_manager . clone ( ) ,
2548
2624
Some ( Arc :: clone ( & nodes[ 0 ] . liquidity_manager ) ) ,
2625
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2549
2626
nodes[ 0 ] . logger . clone ( ) ,
2550
2627
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2551
2628
move |dur : Duration | {
@@ -2709,6 +2786,7 @@ mod tests {
2709
2786
nodes[ 0 ] . no_gossip_sync ( ) ,
2710
2787
nodes[ 0 ] . peer_manager . clone ( ) ,
2711
2788
Some ( Arc :: clone ( & nodes[ 0 ] . liquidity_manager ) ) ,
2789
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2712
2790
nodes[ 0 ] . logger . clone ( ) ,
2713
2791
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2714
2792
) ;
@@ -2760,6 +2838,7 @@ mod tests {
2760
2838
nodes[ 0 ] . no_gossip_sync ( ) ,
2761
2839
nodes[ 0 ] . peer_manager . clone ( ) ,
2762
2840
Some ( Arc :: clone ( & nodes[ 0 ] . liquidity_manager ) ) ,
2841
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2763
2842
nodes[ 0 ] . logger . clone ( ) ,
2764
2843
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2765
2844
move |dur : Duration | {
0 commit comments