+//! 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()),
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,
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 {