X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning%2Fsrc%2Frouting%2Fgossip.rs;h=10ce74b971e6eebd13054257826aa78cbec94276;hb=092d1c1f0df67b9a7c17d0424f1307d7395a7d22;hp=716ca2b305f3a48da3b5c698c571b11fed2fcdd0;hpb=92ca7ff129ada1f8f86c88b204fbe73700bc05b0;p=rust-lightning diff --git a/lightning/src/routing/gossip.rs b/lightning/src/routing/gossip.rs index 716ca2b3..10ce74b9 100644 --- a/lightning/src/routing/gossip.rs +++ b/lightning/src/routing/gossip.rs @@ -816,10 +816,6 @@ impl<'a> DirectedChannelInfoWithUpdate<'a> { /// Returns the [`EffectiveCapacity`] of the channel in the direction. #[inline] pub(super) fn effective_capacity(&self) -> EffectiveCapacity { self.inner.effective_capacity() } - - /// Returns the maximum HTLC amount allowed over the channel in the direction. - #[inline] - pub(super) fn htlc_maximum_msat(&self) -> u64 { self.inner.htlc_maximum_msat() } } impl<'a> fmt::Debug for DirectedChannelInfoWithUpdate<'a> { @@ -1649,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 @@ -1656,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.