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)?;