You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/util/configurations.rs
+20-15Lines changed: 20 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -7,14 +7,14 @@
7
7
/// It wraps the ChannelHandshakeLimits struct and ChannelConfig struct into a single one for channel manager.
8
8
#[derive(Clone,Debug)]
9
9
pubstructUserConfig{
10
-
/// optional user specified channel limits
10
+
/// optional user specified channel limits, this hold information regarding handshakes of channels.
11
11
pubchannel_limits:ChannelHandshakeLimits,
12
-
/// channel specific options
12
+
/// channel specific options and settings egis channel announced or not
13
13
pubchannel_options:ChannelConfig,
14
14
}
15
15
16
16
implUserConfig{
17
-
///default constructor, calls ChannelOptions and ChannelLimits constructors
17
+
///default constructor, calls default ChannelOptions and default ChannelLimits constructors
18
18
pubfnnew() -> Self{
19
19
UserConfig{
20
20
channel_limits:ChannelHandshakeLimits::new(),
@@ -24,33 +24,36 @@ impl UserConfig {
24
24
}
25
25
26
26
/// This struct contains all the optional channel limits. If these limits are breached the new channel will be denied
27
-
/// If the user wants to check a value, the value needs to be filled in, as by default they are not checked
27
+
/// If the user wants to check a value, the value needs to be filled in, as by default most are not checked
28
28
#[derive(Copy,Clone,Debug)]
29
29
pubstructChannelHandshakeLimits{
30
-
/// minimum allowed satishis when funding a channel.
30
+
/// minimum allowed satoshis when a channel is funded, this is supplied by the sender.
31
31
pubmin_funding_satoshis:u64,
32
-
/// maximum allowed min HTLC that will be accepted.
32
+
/// maximum allowed smallest HTLC that will be accepted by us.
33
33
pubmax_htlc_minimum_msat:u64,
34
-
/// min allowed cap on outstanding HTLC, used to limit exposure.
34
+
/// min allowed cap on outstanding HTLC. This is used to limit exposure to HTLCs.
35
35
pubmin_max_htlc_value_in_flight_msat:u64,
36
-
/// max allowed satoshis that may be used as a direct payment.
36
+
/// max allowed satoshis that may be used as a direct payment by the peer.
37
37
pubmax_channel_reserve_satoshis:u64,
38
38
/// min allowed max outstanding HTLC that can be offered.
39
39
pubmin_max_accepted_htlcs:u16,
40
40
/// min allowed threshold below which outputs should not be generated.
41
+
/// These outputs are either commitment or HTLC transactions.
42
+
/// HTLCs below this amount plus HTLC transaction fees are not enforceable on-chain.
43
+
/// This reflects the reality that tiny outputs are not considered standard transactions and will not propagate through the Bitcoin network
41
44
pubmin_dust_limit_satoshis:u64,
42
45
/// max allowed threshold above which outputs should not be generated. Bolt 2 mentions channel_reserve_satoshis as upper limit, but this can be a lower limit
43
46
pubmax_dust_limit_satoshis:u64,
44
-
///minimum depth to a number of blocks that is considered reasonable to avoid double-spending of the funding transaction
47
+
///minimum depth to a number of blocks that is considered reasonable to avoid double-spending of the funding transaction
45
48
pubminimum_depth:u32,
46
-
///do we force the incoming channel to match our announced channel preference
49
+
///do we force the incoming channel to match our announced channel preference
47
50
pubforce_announced_channel_preference:bool,
48
51
}
49
52
50
53
implChannelHandshakeLimits{
51
54
//creating max and min possible values because if they are not set, means we should not check them.
52
55
///default constructor creates limits so that they are not tested for
53
-
///min_dust_limit_satoshis is set to the network default of 546
56
+
///min_dust_limit_satoshis is set to the network default of 546
54
57
pubfnnew() -> Self{
55
58
ChannelHandshakeLimits{
56
59
min_funding_satoshis:0,
@@ -69,15 +72,17 @@ impl ChannelHandshakeLimits {
69
72
/// This struct contains all the custom channel options.
70
73
#[derive(Copy,Clone,Debug)]
71
74
pubstructChannelConfig{
72
-
/// Amount (in millionths of a satoshi) channel will charge per transferred satoshi.
75
+
/// Amount (in millionths of a satoshi) the channel will charge per transferred satoshi.
76
+
/// This must be updated as the channel updates and can change in runtime.
73
77
pubfee_proportional_millionths:u32,
74
78
//TODO enforce non-mutability when config can change at runtime
75
-
///Is this channel an announced channel, cannot change after channel creation
79
+
///Is this channel publicly announced channel or not.
80
+
///This cannot change after channel creation.
76
81
pubannounced_channel:bool,
77
82
}
78
83
implChannelConfig{
79
-
/// creating a struct with values.
80
-
/// fee_proportional_millionths should be changed afterwords
84
+
/// creating a struct with default values.
85
+
/// fee_proportional_millionths should be changed and updated afterwords
0 commit comments