@@ -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 ;
@@ -130,6 +132,11 @@ const REBROADCAST_TIMER: u64 = 30;
130
132
#[ cfg( test) ]
131
133
const REBROADCAST_TIMER : u64 = 1 ;
132
134
135
+ #[ cfg( not( test) ) ]
136
+ const SWEEPER_TIMER : u64 = 30 ;
137
+ #[ cfg( test) ]
138
+ const SWEEPER_TIMER : u64 = 1 ;
139
+
133
140
#[ cfg( feature = "futures" ) ]
134
141
/// core::cmp::min is not currently const, so we define a trivial (and equivalent) replacement
135
142
const fn min_u64 ( a : u64 , b : u64 ) -> u64 {
@@ -306,6 +313,7 @@ macro_rules! define_run_body {
306
313
$channel_manager: ident, $process_channel_manager_events: expr,
307
314
$onion_messenger: ident, $process_onion_message_handler_events: expr,
308
315
$peer_manager: ident, $gossip_sync: ident,
316
+ $process_sweeper: expr,
309
317
$logger: ident, $scorer: ident, $loop_exit_check: expr, $await: expr, $get_timer: expr,
310
318
$timer_elapsed: expr, $check_slow_await: expr, $time_fetch: expr,
311
319
) => { {
@@ -320,6 +328,7 @@ macro_rules! define_run_body {
320
328
let mut last_prune_call = $get_timer( FIRST_NETWORK_PRUNE_TIMER ) ;
321
329
let mut last_scorer_persist_call = $get_timer( SCORER_PERSIST_TIMER ) ;
322
330
let mut last_rebroadcast_call = $get_timer( REBROADCAST_TIMER ) ;
331
+ let mut last_sweeper_call = $get_timer( SWEEPER_TIMER ) ;
323
332
let mut have_pruned = false ;
324
333
let mut have_decayed_scorer = false ;
325
334
@@ -461,6 +470,12 @@ macro_rules! define_run_body {
461
470
$chain_monitor. rebroadcast_pending_claims( ) ;
462
471
last_rebroadcast_call = $get_timer( REBROADCAST_TIMER ) ;
463
472
}
473
+
474
+ if $timer_elapsed( & mut last_sweeper_call, SWEEPER_TIMER ) {
475
+ log_trace!( $logger, "Regenerating sweeper spends if necessary" ) ;
476
+ let _ = $process_sweeper;
477
+ last_sweeper_call = $get_timer( SWEEPER_TIMER ) ;
478
+ }
464
479
}
465
480
466
481
// After we exit, ensure we persist the ChannelManager one final time - this avoids
@@ -618,6 +633,7 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
618
633
/// ```
619
634
/// # use lightning::io;
620
635
/// # use lightning::events::ReplayEvent;
636
+ /// # use lightning::util::sweep::OutputSweeper;
621
637
/// # use std::sync::{Arc, RwLock};
622
638
/// # use std::sync::atomic::{AtomicBool, Ordering};
623
639
/// # use std::time::SystemTime;
@@ -656,6 +672,9 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
656
672
/// # F: lightning::chain::Filter + Send + Sync + 'static,
657
673
/// # FE: lightning::chain::chaininterface::FeeEstimator + Send + Sync + 'static,
658
674
/// # UL: lightning::routing::utxo::UtxoLookup + Send + Sync + 'static,
675
+ /// # D: lightning::sign::ChangeDestinationSource + Send + Sync + 'static,
676
+ /// # K: lightning::util::persist::KVStore + Send + Sync + 'static,
677
+ /// # O: lightning::sign::OutputSpender + Send + Sync + 'static,
659
678
/// # > {
660
679
/// # peer_manager: Arc<PeerManager<B, F, FE, UL>>,
661
680
/// # event_handler: Arc<EventHandler>,
@@ -666,14 +685,18 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
666
685
/// # persister: Arc<Store>,
667
686
/// # logger: Arc<Logger>,
668
687
/// # scorer: Arc<Scorer>,
688
+ /// # sweeper: Arc<OutputSweeper<Arc<B>, Arc<D>, Arc<FE>, Arc<F>, Arc<K>, Arc<Logger>, Arc<O>>>,
669
689
/// # }
670
690
/// #
671
691
/// # async fn setup_background_processing<
672
692
/// # B: lightning::chain::chaininterface::BroadcasterInterface + Send + Sync + 'static,
673
693
/// # F: lightning::chain::Filter + Send + Sync + 'static,
674
694
/// # FE: lightning::chain::chaininterface::FeeEstimator + Send + Sync + 'static,
675
695
/// # UL: lightning::routing::utxo::UtxoLookup + Send + Sync + 'static,
676
- /// # >(node: Node<B, F, FE, UL>) {
696
+ /// # D: lightning::sign::ChangeDestinationSource + Send + Sync + 'static,
697
+ /// # K: lightning::util::persist::KVStore + Send + Sync + 'static,
698
+ /// # O: lightning::sign::OutputSpender + Send + Sync + 'static,
699
+ /// # >(node: Node<B, F, FE, UL, D, K, O>) {
677
700
/// let background_persister = Arc::clone(&node.persister);
678
701
/// let background_event_handler = Arc::clone(&node.event_handler);
679
702
/// let background_chain_mon = Arc::clone(&node.chain_monitor);
@@ -683,7 +706,8 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
683
706
/// let background_onion_messenger = Arc::clone(&node.onion_messenger);
684
707
/// let background_logger = Arc::clone(&node.logger);
685
708
/// let background_scorer = Arc::clone(&node.scorer);
686
- ///
709
+ /// let background_sweeper = Arc::clone(&node.sweeper);
710
+
687
711
/// // Setup the sleeper.
688
712
/// let (stop_sender, stop_receiver) = tokio::sync::watch::channel(());
689
713
///
@@ -708,6 +732,7 @@ use futures_util::{dummy_waker, OptionalSelector, Selector, SelectorOutput};
708
732
/// Some(background_onion_messenger),
709
733
/// background_gossip_sync,
710
734
/// background_peer_man,
735
+ /// Some(background_sweeper),
711
736
/// background_logger,
712
737
/// Some(background_scorer),
713
738
/// sleeper,
@@ -742,6 +767,10 @@ pub async fn process_events_async<
742
767
+ Sync ,
743
768
CM : ' static + Deref + Send + Sync ,
744
769
OM : ' static + Deref + Send + Sync ,
770
+ D : ' static + Deref ,
771
+ O : ' static + Deref ,
772
+ K : ' static + Deref ,
773
+ OS : ' static + Deref < Target = OutputSweeper < T , D , F , CF , K , L , O > > ,
745
774
PGS : ' static + Deref < Target = P2PGossipSync < G , UL , L > > + Send + Sync ,
746
775
RGS : ' static + Deref < Target = RapidGossipSync < G , L > > + Send ,
747
776
PM : ' static + Deref + Send + Sync ,
@@ -753,12 +782,12 @@ pub async fn process_events_async<
753
782
> (
754
783
persister : PS , event_handler : EventHandler , chain_monitor : M , channel_manager : CM ,
755
784
onion_messenger : Option < OM > , gossip_sync : GossipSync < PGS , RGS , G , UL , L > , peer_manager : PM ,
756
- logger : L , scorer : Option < S > , sleeper : Sleeper , mobile_interruptable_platform : bool ,
757
- fetch_time : FetchTime ,
785
+ sweeper : Option < OS > , logger : L , scorer : Option < S > , sleeper : Sleeper ,
786
+ mobile_interruptable_platform : bool , fetch_time : FetchTime ,
758
787
) -> Result < ( ) , lightning:: io:: Error >
759
788
where
760
789
UL :: Target : ' static + UtxoLookup ,
761
- CF :: Target : ' static + chain:: Filter ,
790
+ CF :: Target : ' static + chain:: Filter + Sync + Send ,
762
791
T :: Target : ' static + BroadcasterInterface ,
763
792
F :: Target : ' static + FeeEstimator ,
764
793
L :: Target : ' static + Logger ,
@@ -767,6 +796,9 @@ where
767
796
CM :: Target : AChannelManager + Send + Sync ,
768
797
OM :: Target : AOnionMessenger + Send + Sync ,
769
798
PM :: Target : APeerManager + Send + Sync ,
799
+ O :: Target : ' static + OutputSpender ,
800
+ D :: Target : ' static + ChangeDestinationSource ,
801
+ K :: Target : ' static + KVStore ,
770
802
{
771
803
let mut should_break = false ;
772
804
let async_event_handler = |event| {
@@ -810,6 +842,13 @@ where
810
842
} ,
811
843
peer_manager,
812
844
gossip_sync,
845
+ {
846
+ if let Some ( ref sweeper) = sweeper {
847
+ sweeper. regenerate_and_broadcast_spend_if_necessary( )
848
+ } else {
849
+ Ok ( ( ) )
850
+ }
851
+ } ,
813
852
logger,
814
853
scorer,
815
854
should_break,
@@ -922,14 +961,18 @@ impl BackgroundProcessor {
922
961
PM : ' static + Deref + Send + Sync ,
923
962
S : ' static + Deref < Target = SC > + Send + Sync ,
924
963
SC : for < ' b > WriteableScore < ' b > ,
964
+ D : ' static + Deref ,
965
+ O : ' static + Deref ,
966
+ K : ' static + Deref ,
967
+ OS : ' static + Deref < Target = OutputSweeper < T , D , F , CF , K , L , O > > + Send + Sync ,
925
968
> (
926
969
persister : PS , event_handler : EH , chain_monitor : M , channel_manager : CM ,
927
970
onion_messenger : Option < OM > , gossip_sync : GossipSync < PGS , RGS , G , UL , L > , peer_manager : PM ,
928
- logger : L , scorer : Option < S > ,
971
+ sweeper : Option < OS > , logger : L , scorer : Option < S > ,
929
972
) -> Self
930
973
where
931
974
UL :: Target : ' static + UtxoLookup ,
932
- CF :: Target : ' static + chain:: Filter ,
975
+ CF :: Target : ' static + chain:: Filter + Sync + Send ,
933
976
T :: Target : ' static + BroadcasterInterface ,
934
977
F :: Target : ' static + FeeEstimator ,
935
978
L :: Target : ' static + Logger ,
@@ -938,6 +981,9 @@ impl BackgroundProcessor {
938
981
CM :: Target : AChannelManager + Send + Sync ,
939
982
OM :: Target : AOnionMessenger + Send + Sync ,
940
983
PM :: Target : APeerManager + Send + Sync ,
984
+ O :: Target : ' static + OutputSpender ,
985
+ D :: Target : ' static + ChangeDestinationSource ,
986
+ K :: Target : ' static + KVStore ,
941
987
{
942
988
let stop_thread = Arc :: new ( AtomicBool :: new ( false ) ) ;
943
989
let stop_thread_clone = stop_thread. clone ( ) ;
@@ -973,6 +1019,13 @@ impl BackgroundProcessor {
973
1019
} ,
974
1020
peer_manager,
975
1021
gossip_sync,
1022
+ {
1023
+ if let Some ( ref sweeper) = sweeper {
1024
+ sweeper. regenerate_and_broadcast_spend_if_necessary( )
1025
+ } else {
1026
+ Ok ( ( ) )
1027
+ }
1028
+ } ,
976
1029
logger,
977
1030
scorer,
978
1031
stop_thread. load( Ordering :: Acquire ) ,
@@ -1069,7 +1122,7 @@ mod tests {
1069
1122
use core:: sync:: atomic:: { AtomicBool , Ordering } ;
1070
1123
use lightning:: chain:: channelmonitor:: ANTI_REORG_DELAY ;
1071
1124
use lightning:: chain:: transaction:: OutPoint ;
1072
- use lightning:: chain:: { chainmonitor, BestBlock , Confirm , Filter } ;
1125
+ use lightning:: chain:: { chainmonitor, BestBlock , Confirm } ;
1073
1126
use lightning:: events:: { Event , PathFailure , ReplayEvent } ;
1074
1127
use lightning:: ln:: channelmanager;
1075
1128
use lightning:: ln:: channelmanager:: {
@@ -1222,7 +1275,7 @@ mod tests {
1222
1275
Arc < test_utils:: TestBroadcaster > ,
1223
1276
Arc < TestWallet > ,
1224
1277
Arc < test_utils:: TestFeeEstimator > ,
1225
- Arc < dyn Filter + Sync + Send > ,
1278
+ Arc < test_utils :: TestChainSource > ,
1226
1279
Arc < FilesystemStore > ,
1227
1280
Arc < test_utils:: TestLogger > ,
1228
1281
Arc < KeysManager > ,
@@ -1601,7 +1654,7 @@ mod tests {
1601
1654
best_block,
1602
1655
Arc :: clone ( & tx_broadcaster) ,
1603
1656
Arc :: clone ( & fee_estimator) ,
1604
- None :: < Arc < dyn Filter + Sync + Send > > ,
1657
+ None :: < Arc < test_utils :: TestChainSource > > ,
1605
1658
Arc :: clone ( & keys_manager) ,
1606
1659
wallet,
1607
1660
Arc :: clone ( & kv_store) ,
@@ -1831,6 +1884,7 @@ mod tests {
1831
1884
Some ( nodes[ 0 ] . messenger . clone ( ) ) ,
1832
1885
nodes[ 0 ] . p2p_gossip_sync ( ) ,
1833
1886
nodes[ 0 ] . peer_manager . clone ( ) ,
1887
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
1834
1888
nodes[ 0 ] . logger . clone ( ) ,
1835
1889
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
1836
1890
) ;
@@ -1924,6 +1978,7 @@ mod tests {
1924
1978
Some ( nodes[ 0 ] . messenger . clone ( ) ) ,
1925
1979
nodes[ 0 ] . no_gossip_sync ( ) ,
1926
1980
nodes[ 0 ] . peer_manager . clone ( ) ,
1981
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
1927
1982
nodes[ 0 ] . logger . clone ( ) ,
1928
1983
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
1929
1984
) ;
@@ -1966,6 +2021,7 @@ mod tests {
1966
2021
Some ( nodes[ 0 ] . messenger . clone ( ) ) ,
1967
2022
nodes[ 0 ] . no_gossip_sync ( ) ,
1968
2023
nodes[ 0 ] . peer_manager . clone ( ) ,
2024
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
1969
2025
nodes[ 0 ] . logger . clone ( ) ,
1970
2026
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
1971
2027
) ;
@@ -1998,6 +2054,7 @@ mod tests {
1998
2054
Some ( nodes[ 0 ] . messenger . clone ( ) ) ,
1999
2055
nodes[ 0 ] . rapid_gossip_sync ( ) ,
2000
2056
nodes[ 0 ] . peer_manager . clone ( ) ,
2057
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2001
2058
nodes[ 0 ] . logger . clone ( ) ,
2002
2059
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2003
2060
move |dur : Duration | {
@@ -2034,6 +2091,7 @@ mod tests {
2034
2091
Some ( nodes[ 0 ] . messenger . clone ( ) ) ,
2035
2092
nodes[ 0 ] . p2p_gossip_sync ( ) ,
2036
2093
nodes[ 0 ] . peer_manager . clone ( ) ,
2094
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2037
2095
nodes[ 0 ] . logger . clone ( ) ,
2038
2096
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2039
2097
) ;
@@ -2063,6 +2121,7 @@ mod tests {
2063
2121
Some ( nodes[ 0 ] . messenger . clone ( ) ) ,
2064
2122
nodes[ 0 ] . no_gossip_sync ( ) ,
2065
2123
nodes[ 0 ] . peer_manager . clone ( ) ,
2124
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2066
2125
nodes[ 0 ] . logger . clone ( ) ,
2067
2126
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2068
2127
) ;
@@ -2109,6 +2168,7 @@ mod tests {
2109
2168
Some ( nodes[ 0 ] . messenger . clone ( ) ) ,
2110
2169
nodes[ 0 ] . no_gossip_sync ( ) ,
2111
2170
nodes[ 0 ] . peer_manager . clone ( ) ,
2171
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2112
2172
nodes[ 0 ] . logger . clone ( ) ,
2113
2173
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2114
2174
) ;
@@ -2171,6 +2231,7 @@ mod tests {
2171
2231
Some ( nodes[ 0 ] . messenger . clone ( ) ) ,
2172
2232
nodes[ 0 ] . no_gossip_sync ( ) ,
2173
2233
nodes[ 0 ] . peer_manager . clone ( ) ,
2234
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2174
2235
nodes[ 0 ] . logger . clone ( ) ,
2175
2236
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2176
2237
) ;
@@ -2216,10 +2277,22 @@ mod tests {
2216
2277
2217
2278
advance_chain ( & mut nodes[ 0 ] , 3 ) ;
2218
2279
2280
+ let tx_broadcaster = nodes[ 0 ] . tx_broadcaster . clone ( ) ;
2281
+ let wait_for_sweep_tx = || -> Transaction {
2282
+ loop {
2283
+ let sweep_tx = tx_broadcaster. txn_broadcasted . lock ( ) . unwrap ( ) . pop ( ) ;
2284
+ if let Some ( sweep_tx) = sweep_tx {
2285
+ return sweep_tx;
2286
+ }
2287
+
2288
+ std:: thread:: sleep ( Duration :: from_millis ( 100 ) ) ;
2289
+ }
2290
+ } ;
2291
+
2219
2292
// Check we generate an initial sweeping tx.
2220
2293
assert_eq ! ( nodes[ 0 ] . sweeper. tracked_spendable_outputs( ) . len( ) , 1 ) ;
2294
+ let sweep_tx_0 = wait_for_sweep_tx ( ) ;
2221
2295
let tracked_output = nodes[ 0 ] . sweeper . tracked_spendable_outputs ( ) . first ( ) . unwrap ( ) . clone ( ) ;
2222
- let sweep_tx_0 = nodes[ 0 ] . tx_broadcaster . txn_broadcasted . lock ( ) . unwrap ( ) . pop ( ) . unwrap ( ) ;
2223
2296
match tracked_output. status {
2224
2297
OutputSpendStatus :: PendingFirstConfirmation { latest_spending_tx, .. } => {
2225
2298
assert_eq ! ( sweep_tx_0. compute_txid( ) , latest_spending_tx. compute_txid( ) ) ;
@@ -2230,8 +2303,8 @@ mod tests {
2230
2303
// Check we regenerate and rebroadcast the sweeping tx each block.
2231
2304
advance_chain ( & mut nodes[ 0 ] , 1 ) ;
2232
2305
assert_eq ! ( nodes[ 0 ] . sweeper. tracked_spendable_outputs( ) . len( ) , 1 ) ;
2306
+ let sweep_tx_1 = wait_for_sweep_tx ( ) ;
2233
2307
let tracked_output = nodes[ 0 ] . sweeper . tracked_spendable_outputs ( ) . first ( ) . unwrap ( ) . clone ( ) ;
2234
- let sweep_tx_1 = nodes[ 0 ] . tx_broadcaster . txn_broadcasted . lock ( ) . unwrap ( ) . pop ( ) . unwrap ( ) ;
2235
2308
match tracked_output. status {
2236
2309
OutputSpendStatus :: PendingFirstConfirmation { latest_spending_tx, .. } => {
2237
2310
assert_eq ! ( sweep_tx_1. compute_txid( ) , latest_spending_tx. compute_txid( ) ) ;
@@ -2242,8 +2315,8 @@ mod tests {
2242
2315
2243
2316
advance_chain ( & mut nodes[ 0 ] , 1 ) ;
2244
2317
assert_eq ! ( nodes[ 0 ] . sweeper. tracked_spendable_outputs( ) . len( ) , 1 ) ;
2318
+ let sweep_tx_2 = wait_for_sweep_tx ( ) ;
2245
2319
let tracked_output = nodes[ 0 ] . sweeper . tracked_spendable_outputs ( ) . first ( ) . unwrap ( ) . clone ( ) ;
2246
- let sweep_tx_2 = nodes[ 0 ] . tx_broadcaster . txn_broadcasted . lock ( ) . unwrap ( ) . pop ( ) . unwrap ( ) ;
2247
2320
match tracked_output. status {
2248
2321
OutputSpendStatus :: PendingFirstConfirmation { latest_spending_tx, .. } => {
2249
2322
assert_eq ! ( sweep_tx_2. compute_txid( ) , latest_spending_tx. compute_txid( ) ) ;
@@ -2322,6 +2395,7 @@ mod tests {
2322
2395
Some ( nodes[ 0 ] . messenger . clone ( ) ) ,
2323
2396
nodes[ 0 ] . no_gossip_sync ( ) ,
2324
2397
nodes[ 0 ] . peer_manager . clone ( ) ,
2398
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2325
2399
nodes[ 0 ] . logger . clone ( ) ,
2326
2400
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2327
2401
) ;
@@ -2351,6 +2425,7 @@ mod tests {
2351
2425
Some ( nodes[ 0 ] . messenger . clone ( ) ) ,
2352
2426
nodes[ 0 ] . no_gossip_sync ( ) ,
2353
2427
nodes[ 0 ] . peer_manager . clone ( ) ,
2428
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2354
2429
nodes[ 0 ] . logger . clone ( ) ,
2355
2430
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2356
2431
) ;
@@ -2446,6 +2521,7 @@ mod tests {
2446
2521
Some ( nodes[ 0 ] . messenger . clone ( ) ) ,
2447
2522
nodes[ 0 ] . rapid_gossip_sync ( ) ,
2448
2523
nodes[ 0 ] . peer_manager . clone ( ) ,
2524
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2449
2525
nodes[ 0 ] . logger . clone ( ) ,
2450
2526
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2451
2527
) ;
@@ -2478,6 +2554,7 @@ mod tests {
2478
2554
Some ( nodes[ 0 ] . messenger . clone ( ) ) ,
2479
2555
nodes[ 0 ] . rapid_gossip_sync ( ) ,
2480
2556
nodes[ 0 ] . peer_manager . clone ( ) ,
2557
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2481
2558
nodes[ 0 ] . logger . clone ( ) ,
2482
2559
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2483
2560
move |dur : Duration | {
@@ -2640,6 +2717,7 @@ mod tests {
2640
2717
Some ( nodes[ 0 ] . messenger . clone ( ) ) ,
2641
2718
nodes[ 0 ] . no_gossip_sync ( ) ,
2642
2719
nodes[ 0 ] . peer_manager . clone ( ) ,
2720
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2643
2721
nodes[ 0 ] . logger . clone ( ) ,
2644
2722
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2645
2723
) ;
@@ -2690,6 +2768,7 @@ mod tests {
2690
2768
Some ( nodes[ 0 ] . messenger . clone ( ) ) ,
2691
2769
nodes[ 0 ] . no_gossip_sync ( ) ,
2692
2770
nodes[ 0 ] . peer_manager . clone ( ) ,
2771
+ Some ( nodes[ 0 ] . sweeper . clone ( ) ) ,
2693
2772
nodes[ 0 ] . logger . clone ( ) ,
2694
2773
Some ( nodes[ 0 ] . scorer . clone ( ) ) ,
2695
2774
move |dur : Duration | {
0 commit comments