const MAX_EXCESS_BYTES_FOR_RELAY: usize = 1024;
/// Represents the network as nodes and channels between them
-#[derive(PartialEq)]
+#[derive(Clone, PartialEq)]
pub struct NetworkGraph {
genesis_hash: BlockHash,
channels: BTreeMap<u64, ChannelInfo>,
}
}
+ /// Adds a provider used to check new announcements. Does not affect
+ /// existing announcements unless they are updated.
+ /// Add, update or remove the provider would replace the current one.
+ pub fn add_chain_access(&mut self, chain_access: Option<C>) {
+ self.chain_access = chain_access;
+ }
+
/// Take a read lock on the network_graph and return it in the C-bindings
/// newtype helper. This is likely only useful when called via the C
/// bindings as you can call `self.network_graph.read().unwrap()` in Rust
}
}
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Debug, PartialEq)]
/// Details about one direction of a channel. Received
/// within a channel update.
pub struct DirectionalChannelInfo {
last_update_message
});
-#[derive(PartialEq)]
+#[derive(Clone, Debug, PartialEq)]
/// Details about a channel (both directions).
/// Received within a channel announcement.
pub struct ChannelInfo {
}
}
-#[derive(Clone, PartialEq, Debug)]
+#[derive(Clone, Debug, PartialEq)]
/// Information received in the latest node_announcement from this node.
pub struct NodeAnnouncementInfo {
/// Protocol features the node announced support for
}
}
-#[derive(Clone, PartialEq)]
+#[derive(Clone, Debug, PartialEq)]
/// Details about a node in the network, known from the network announcement.
pub struct NodeInfo {
/// All valid channels a node has announced