add documents and comments
authorSchalk van Heerden <swvheerden@gmail.com>
Wed, 26 Sep 2018 13:44:22 +0000 (15:44 +0200)
committerSchalk van Heerden <swvheerden@gmail.com>
Wed, 26 Sep 2018 13:44:22 +0000 (15:44 +0200)
src/util/configurations.rs
src/util/mod.rs

index dab09b30f8a0e9819f36dd352bdab8bbe85dde07..0aa80542604d0402d5df17cda1a60a2294e7becb 100644 (file)
@@ -1,17 +1,21 @@
+//! This is the config struct used to pass in configurations into the channel. This is kept by the channel manager
+//! channel_limits is kept in an arc so that each channel can keep a reference to the parent one in channel manager
+//! channel options is cloned into channel because those are all specified unique channel settings. It uses channel managers one as a base
 use std::sync::Arc;
 
 /// This is the main user configuration
 /// This struct should contain all user customizable options as this is passed to the channel to be accessed
 #[derive(Clone, Debug)]
 pub struct UserConfigurations{
-       /// optional user spesefied channel limits
-       /// These are only used on startup of channels, and are referanced to a single instance
+       /// optional user specified channel limits
+       /// These are only used on startup of channels, and are referenced to a single instance
     pub channel_limits : Arc<ChannelLimits>,
        /// Channel options can change afterwords and are unique to each channel
        pub channel_options : ChannelOptions,
 }
 
 impl UserConfigurations {
+       ///default constructor, calls ChannelOptions and ChannelLimits constructors
     pub fn new() -> Self{
         UserConfigurations {
             channel_limits : Arc::new(ChannelLimits::new()),
@@ -42,6 +46,7 @@ pub struct ChannelLimits{
 
 impl ChannelLimits {
 //creating max and min possible values because if they are not set, means we should not check them.
+       ///default constructor creates limits so that they are not tested for
        pub fn new() -> Self{
                ChannelLimits {
                        funding_satoshis : 0,
@@ -60,9 +65,9 @@ impl ChannelLimits {
 pub struct ChannelOptions{
        /// Amount (in millionths of a satoshi) channel will charge per transferred satoshi.
        pub fee_proportional_millionths : u32,
-       ///Is this channel an annouced channe;
+       ///Is this channel an announced channel;
        pub announced_channel : bool,
-       ///do we force the incomming channel to match our announced channel preference
+       ///do we force the incoming channel to match our announced channel preference
        pub force_announced_channel_preference : bool,
 }
 impl ChannelOptions {
index eb25dc7e82f7a40c8998674f12067f2dad2c02b3..be465103a554e1df66e1b2866cc372f0610d5154 100644 (file)
@@ -30,4 +30,5 @@ pub use self::rng::reset_rng_state;
 pub(crate) mod test_utils;
 
 pub use self::configurations::UserConfigurations;
+//config struct
 pub mod configurations;
\ No newline at end of file