@@ -51,6 +51,8 @@ use lightning_liquidity::ALiquidityManager;
51
51
52
52
use core:: ops:: Deref ;
53
53
use core:: time:: Duration ;
54
+ #[ cfg( feature = "std" ) ]
55
+ use std:: marker:: PhantomData ;
54
56
55
57
#[ cfg( feature = "std" ) ]
56
58
use core:: sync:: atomic:: { AtomicBool , Ordering } ;
@@ -64,9 +66,6 @@ use std::time::Instant;
64
66
#[ cfg( not( feature = "std" ) ) ]
65
67
use alloc:: boxed:: Box ;
66
68
67
- #[ cfg( feature = "std" ) ]
68
- use std:: marker:: PhantomData ;
69
-
70
69
/// `BackgroundProcessor` takes care of tasks that (1) need to happen periodically to keep
71
70
/// Rust-Lightning running properly, and (2) either can or should be run in the background. Its
72
71
/// responsibilities are:
@@ -1133,7 +1132,7 @@ impl BackgroundProcessor {
1133
1132
K : ' static + Deref ,
1134
1133
OS : ' static + Deref < Target = OutputSweeperSync < T , D , F , CF , K , L , O > > + Send ,
1135
1134
> (
1136
- config : BackgroundProcessorConfig <
1135
+ # [ rustfmt :: skip ] config : BackgroundProcessorConfig <
1137
1136
' a ,
1138
1137
UL ,
1139
1138
CF ,
@@ -1238,7 +1237,7 @@ impl BackgroundProcessor {
1238
1237
/// including required components (like the channel manager and peer manager) and optional
1239
1238
/// components (like the liquidity_manager, sweeper, onion messenger and scorer).
1240
1239
///
1241
- /// The configuration can be constructed using [`BackgroundProcessorBuilder `], which provides
1240
+ /// The configuration can be constructed using [`BackgroundProcessorConfigBuilder `], which provides
1242
1241
/// a convenient builder pattern for setting up both required and optional components.
1243
1242
///
1244
1243
/// This same configuration can be used for Creating a [`BackgroundProcessor`] via [`BackgroundProcessor::from_config`]
@@ -1300,13 +1299,13 @@ pub struct BackgroundProcessorConfig<
1300
1299
_phantom : PhantomData < ( & ' a ( ) , CF , T , F , P ) > ,
1301
1300
}
1302
1301
1303
- /// A builder for constructing a [`BackgroundProcessor `] with optional components.
1302
+ /// A builder for constructing a [`BackgroundProcessorConfig `] with optional components.
1304
1303
///
1305
- /// This builder provides a flexible and type-safe way to construct a [`BackgroundProcessor `]
1304
+ /// This builder provides a flexible and type-safe way to construct a [`BackgroundProcessorConfig `]
1306
1305
/// with optional components like `onion_messenger` and `scorer`. It helps avoid specifying
1307
1306
/// concrete types for components that aren't being used.
1308
1307
#[ cfg( feature = "std" ) ]
1309
- pub struct BackgroundProcessorBuilder <
1308
+ pub struct BackgroundProcessorConfigBuilder <
1310
1309
' a ,
1311
1310
UL : ' static + Deref ,
1312
1311
CF : ' static + Deref ,
@@ -1392,7 +1391,7 @@ impl<
1392
1391
K : ' static + Deref ,
1393
1392
OS : ' static + Deref < Target = OutputSweeperSync < T , D , F , CF , K , L , O > > + Send ,
1394
1393
>
1395
- BackgroundProcessorBuilder <
1394
+ BackgroundProcessorConfigBuilder <
1396
1395
' a ,
1397
1396
UL ,
1398
1397
CF ,
@@ -1531,7 +1530,9 @@ impl Drop for BackgroundProcessor {
1531
1530
1532
1531
#[ cfg( all( feature = "std" , test) ) ]
1533
1532
mod tests {
1534
- use super :: { BackgroundProcessor , BackgroundProcessorBuilder , GossipSync , FRESHNESS_TIMER } ;
1533
+ use super :: {
1534
+ BackgroundProcessor , BackgroundProcessorConfigBuilder , GossipSync , FRESHNESS_TIMER ,
1535
+ } ;
1535
1536
use bitcoin:: constants:: { genesis_block, ChainHash } ;
1536
1537
use bitcoin:: hashes:: Hash ;
1537
1538
use bitcoin:: locktime:: absolute:: LockTime ;
@@ -3248,11 +3249,11 @@ mod tests {
3248
3249
}
3249
3250
3250
3251
#[ test]
3251
- fn test_background_processor_builder ( ) {
3252
+ fn test_background_processor_config_builder ( ) {
3252
3253
// Test that when a new channel is created, the ChannelManager needs to be re-persisted with
3253
3254
// updates. Also test that when new updates are available, the manager signals that it needs
3254
3255
// re-persistence and is successfully re-persisted.
3255
- let ( persist_dir, nodes) = create_nodes ( 2 , "test_background_processor_builder " ) ;
3256
+ let ( persist_dir, nodes) = create_nodes ( 2 , "test_background_processor_config_builder " ) ;
3256
3257
3257
3258
// Go through the channel creation process so that each node has something to persist. Since
3258
3259
// open_channel consumes events, it must complete before starting BackgroundProcessor to
@@ -3263,7 +3264,7 @@ mod tests {
3263
3264
let data_dir = nodes[ 0 ] . kv_store . get_data_dir ( ) ;
3264
3265
let persister = Arc :: new ( Persister :: new ( data_dir) ) ;
3265
3266
let event_handler = |_: _ | Ok ( ( ) ) ;
3266
- let mut builder = BackgroundProcessorBuilder :: new (
3267
+ let mut builder = BackgroundProcessorConfigBuilder :: new (
3267
3268
persister,
3268
3269
event_handler,
3269
3270
nodes[ 0 ] . chain_monitor . clone ( ) ,
0 commit comments