X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Frouting%2Fgossip.rs;h=10ce74b971e6eebd13054257826aa78cbec94276;hb=661b7343e8cb880f059a0f3d7ce60983919ce262;hp=55887623c4032c225befe3d9dfd33fb3a7b1c788;hpb=bd6b710328ec6d116d43162ac6922e5b007e3e3c;p=rust-lightning diff --git a/lightning/src/routing/gossip.rs b/lightning/src/routing/gossip.rs index 55887623..10ce74b9 100644 --- a/lightning/src/routing/gossip.rs +++ b/lightning/src/routing/gossip.rs @@ -1645,6 +1645,11 @@ impl ReadOnlyNetworkGraph<'_> { &*self.channels } + /// Returns information on a channel with the given id. + pub fn channel(&self, short_channel_id: u64) -> Option<&ChannelInfo> { + self.channels.get(&short_channel_id) + } + /// Returns all known nodes' public keys along with announced node info. /// /// (C-not exported) because we have no mapping for `BTreeMap`s @@ -1652,6 +1657,11 @@ impl ReadOnlyNetworkGraph<'_> { &*self.nodes } + /// Returns information on a node with the given id. + pub fn node(&self, node_id: &NodeId) -> Option<&NodeInfo> { + self.nodes.get(node_id) + } + /// Get network addresses by node id. /// Returns None if the requested node is completely unknown, /// or if node announcement for the node was never received.