Skip to content

Commit c5ec561

Browse files
committed
add documents and comments
1 parent 86c84ed commit c5ec561

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/util/configurations.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
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
14
use std::sync::Arc;
25

36
/// This is the main user configuration
47
/// This struct should contain all user customizable options as this is passed to the channel to be accessed
58
#[derive(Clone, Debug)]
69
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
912
pub channel_limits : Arc<ChannelLimits>,
1013
/// Channel options can change afterwords and are unique to each channel
1114
pub channel_options : ChannelOptions,
1215
}
1316

1417
impl UserConfigurations {
18+
///default constructor, calls ChannelOptions and ChannelLimits constructors
1519
pub fn new() -> Self{
1620
UserConfigurations {
1721
channel_limits : Arc::new(ChannelLimits::new()),
@@ -42,6 +46,7 @@ pub struct ChannelLimits{
4246

4347
impl ChannelLimits {
4448
//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
4550
pub fn new() -> Self{
4651
ChannelLimits {
4752
funding_satoshis : 0,
@@ -60,9 +65,9 @@ impl ChannelLimits {
6065
pub struct ChannelOptions{
6166
/// Amount (in millionths of a satoshi) channel will charge per transferred satoshi.
6267
pub fee_proportional_millionths : u32,
63-
///Is this channel an annouced channe;
68+
///Is this channel an announced channel;
6469
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
6671
pub force_announced_channel_preference : bool,
6772
}
6873
impl ChannelOptions {

src/util/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ pub use self::rng::reset_rng_state;
3030
pub(crate) mod test_utils;
3131

3232
pub use self::configurations::UserConfigurations;
33+
//config struct
3334
pub mod configurations;

0 commit comments

Comments
 (0)