1
+ //! This is the config struct used to pass in configurations into the channel. This is kept by the channel manager
2
+ //! channel_limits is kept in an arc so that each channel can keep a reference to the parent one in channel manager
3
+ //! channel options is cloned into channel because those are all specified unique channel settings. It uses channel managers one as a base
1
4
use std:: sync:: Arc ;
2
5
3
6
/// This is the main user configuration
4
7
/// This struct should contain all user customizable options as this is passed to the channel to be accessed
5
8
#[ derive( Clone , Debug ) ]
6
9
pub struct UserConfigurations {
7
- /// optional user spesefied channel limits
8
- /// These are only used on startup of channels, and are referanced to a single instance
10
+ /// optional user specified channel limits
11
+ /// These are only used on startup of channels, and are referenced to a single instance
9
12
pub channel_limits : Arc < ChannelLimits > ,
10
13
/// Channel options can change afterwords and are unique to each channel
11
14
pub channel_options : ChannelOptions ,
12
15
}
13
16
14
17
impl UserConfigurations {
18
+ ///default constructor, calls ChannelOptions and ChannelLimits constructors
15
19
pub fn new ( ) -> Self {
16
20
UserConfigurations {
17
21
channel_limits : Arc :: new ( ChannelLimits :: new ( ) ) ,
@@ -42,6 +46,7 @@ pub struct ChannelLimits{
42
46
43
47
impl ChannelLimits {
44
48
//creating max and min possible values because if they are not set, means we should not check them.
49
+ ///default constructor creates limits so that they are not tested for
45
50
pub fn new ( ) -> Self {
46
51
ChannelLimits {
47
52
funding_satoshis : 0 ,
@@ -60,9 +65,9 @@ impl ChannelLimits {
60
65
pub struct ChannelOptions {
61
66
/// Amount (in millionths of a satoshi) channel will charge per transferred satoshi.
62
67
pub fee_proportional_millionths : u32 ,
63
- ///Is this channel an annouced channe ;
68
+ ///Is this channel an announced channel ;
64
69
pub announced_channel : bool ,
65
- ///do we force the incomming channel to match our announced channel preference
70
+ ///do we force the incoming channel to match our announced channel preference
66
71
pub force_announced_channel_preference : bool ,
67
72
}
68
73
impl ChannelOptions {
0 commit comments