use std::ops::Deref;
use bitcoin::hashes::hex::ToHex;
+/// Represents the network as nodes and channels between them
+#[derive(PartialEq)]
+pub struct NetworkGraph {
+ channels: BTreeMap<u64, ChannelInfo>,
+ nodes: BTreeMap<PublicKey, NodeInfo>,
+}
+
/// Receives and validates network updates from peers,
/// stores authentic and relevant data as a network graph.
/// This network graph is then used for routing payments.
}
}
-/// Represents the network as nodes and channels between them
-#[derive(PartialEq)]
-pub struct NetworkGraph {
- channels: BTreeMap<u64, ChannelInfo>,
- nodes: BTreeMap<PublicKey, NodeInfo>,
-}
-
impl Writeable for NetworkGraph {
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), ::std::io::Error> {
(self.channels.len() as u64).write(writer)?;
use ln::channelmanager::{BREAKDOWN_TIMEOUT, MAX_LOCAL_BREAKDOWN_TIMEOUT};
-/// Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
-///
-/// Default::default() provides sane defaults for most configurations
-/// (but currently with 0 relay fees!)
-#[derive(Clone, Debug)]
-pub struct UserConfig {
- /// Channel config that we propose to our counterparty.
- pub own_channel_config: ChannelHandshakeConfig,
- /// Limits applied to our counterparty's proposed channel config settings.
- pub peer_channel_config_limits: ChannelHandshakeLimits,
- /// Channel config which affects behavior during channel lifetime.
- pub channel_options: ChannelConfig,
-}
-
-impl Default for UserConfig {
- fn default() -> Self {
- UserConfig {
- own_channel_config: ChannelHandshakeConfig::default(),
- peer_channel_config_limits: ChannelHandshakeLimits::default(),
- channel_options: ChannelConfig::default(),
- }
- }
-}
-
/// Configuration we set when applicable.
///
/// Default::default() provides sane defaults.
announced_channel,
commit_upfront_shutdown_pubkey
});
+
+/// Top-level config which holds ChannelHandshakeLimits and ChannelConfig.
+///
+/// Default::default() provides sane defaults for most configurations
+/// (but currently with 0 relay fees!)
+#[derive(Clone, Debug)]
+pub struct UserConfig {
+ /// Channel config that we propose to our counterparty.
+ pub own_channel_config: ChannelHandshakeConfig,
+ /// Limits applied to our counterparty's proposed channel config settings.
+ pub peer_channel_config_limits: ChannelHandshakeLimits,
+ /// Channel config which affects behavior during channel lifetime.
+ pub channel_options: ChannelConfig,
+}
+
+impl Default for UserConfig {
+ fn default() -> Self {
+ UserConfig {
+ own_channel_config: ChannelHandshakeConfig::default(),
+ peer_channel_config_limits: ChannelHandshakeLimits::default(),
+ channel_options: ChannelConfig::default(),
+ }
+ }
+}