Struct lnp::channel::bolt::CommonParams
source · pub struct CommonParams {
pub minimum_depth: u32,
pub feerate_per_kw: u32,
pub announce_channel: bool,
pub channel_type: ChannelType,
}
Expand description
Structure containing part of the channel configuration (and state, as it contains adjustible fee) which must follow specific policies and be accepted or validated basing on those policies and additional protocol-level requirements.
This information applies for both channel peers and used in constructing both sides of asymmetric transactions.
Fields§
§minimum_depth: u32
Minimum depth of the funding transaction before the channel is considered open
feerate_per_kw: u32
indicates the initial fee rate in satoshi per 1000-weight (i.e. 1/4 the more normally-used ‘satoshi per 1000 vbytes’) that this side will pay for commitment and HTLC transactions, as described in BOLT #3 (this can be adjusted later with an update_fee message).
announce_channel: bool
The least-significant bit of channel_flags
. Indicates whether the
initiator of the funding flow wishes to advertise this channel publicly
to the network, as detailed within BOLT #7.
channel_type: ChannelType
Channel types are an explicit enumeration: for convenience of future definitions they reuse even feature bits, but they are not an arbitrary combination (they represent the persistent features which affect the channel operation).
Implementations§
source§impl CommonParams
impl CommonParams
sourcepub fn with(open_channel: &OpenChannel, minimum_depth: u32) -> Self
pub fn with(open_channel: &OpenChannel, minimum_depth: u32) -> Self
Extracts common parameters from the incoming open_channel
message and
local default requirement for the minimum depth.
Trait Implementations§
source§impl Clone for CommonParams
impl Clone for CommonParams
source§fn clone(&self) -> CommonParams
fn clone(&self) -> CommonParams
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CommonParams
impl Debug for CommonParams
source§impl Default for CommonParams
impl Default for CommonParams
source§fn default() -> Self
fn default() -> Self
Sets reasonable values for the common channel parameters used in
constructing open_channel
message.
Usually this should not be used and instead crate::Channel::with
should be provided with custom channel parameters basing on the
current state of the bitcoin mempool and hash rate.
source§impl<'de> Deserialize<'de> for CommonParams
impl<'de> Deserialize<'de> for CommonParams
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl Display for CommonParams
impl Display for CommonParams
source§impl Hash for CommonParams
impl Hash for CommonParams
source§impl PartialEq<CommonParams> for CommonParams
impl PartialEq<CommonParams> for CommonParams
source§fn eq(&self, other: &CommonParams) -> bool
fn eq(&self, other: &CommonParams) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for CommonParams
impl Serialize for CommonParams
source§impl StrictDecode for CommonParams
impl StrictDecode for CommonParams
source§fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
fn strict_decode<D: Read>(d: D) -> Result<Self, Error>
std::io::Read
instance; must either
construct an instance or return implementation-specific error type.source§fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
fn strict_deserialize(data: impl AsRef<[u8]>) -> Result<Self, Error>
StrictDecode::strict_decode
. If there are some data remains in the
buffer once deserialization is completed, fails with
Error::DataNotEntirelyConsumed
. Use io::Cursor
over the buffer and
StrictDecode::strict_decode
to avoid such failures.source§fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
fn strict_file_load(path: impl AsRef<Path>) -> Result<Self, Error>
path
and reconstructs object from it. Fails
with Error::DataNotEntirelyConsumed
if file contains remaining
data after the object reconstruction.source§impl StrictEncode for CommonParams
impl StrictEncode for CommonParams
source§fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
fn strict_encode<E: Write>(&self, e: E) -> Result<usize, Error>
std::io::Write
instance; must return result
with either amount of bytes encoded – or implementation-specific
error type.source§fn strict_serialize(&self) -> Result<Vec<u8, Global>, Error>
fn strict_serialize(&self) -> Result<Vec<u8, Global>, Error>
StrictEncode::strict_encode
functionsource§impl ToYamlString for CommonParams
impl ToYamlString for CommonParams
source§fn to_yaml_string(&self) -> String
fn to_yaml_string(&self) -> String
self
into a YAML-encoded stringimpl Copy for CommonParams
impl Eq for CommonParams
impl StructuralEq for CommonParams
impl StructuralPartialEq for CommonParams
Auto Trait Implementations§
impl RefUnwindSafe for CommonParams
impl Send for CommonParams
impl Sync for CommonParams
impl Unpin for CommonParams
impl UnwindSafe for CommonParams
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.