File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1796,6 +1796,12 @@ impl ReadOnlyNetworkGraph<'_> {
1796
1796
self . channels . get ( & short_channel_id)
1797
1797
}
1798
1798
1799
+ #[ cfg( c_bindings) ] // Non-bindings users should use `channels`
1800
+ /// Returns the list of channels in the graph
1801
+ pub fn list_channels ( & self ) -> Vec < u64 > {
1802
+ self . channels . keys ( ) . map ( |c| * c) . collect ( )
1803
+ }
1804
+
1799
1805
/// Returns all known nodes' public keys along with announced node info.
1800
1806
///
1801
1807
/// (C-not exported) because we have no mapping for `BTreeMap`s
@@ -1808,6 +1814,12 @@ impl ReadOnlyNetworkGraph<'_> {
1808
1814
self . nodes . get ( node_id)
1809
1815
}
1810
1816
1817
+ #[ cfg( c_bindings) ] // Non-bindings users should use `nodes`
1818
+ /// Returns the list of nodes in the graph
1819
+ pub fn list_nodes ( & self ) -> Vec < NodeId > {
1820
+ self . nodes . keys ( ) . map ( |n| * n) . collect ( )
1821
+ }
1822
+
1811
1823
/// Get network addresses by node id.
1812
1824
/// Returns None if the requested node is completely unknown,
1813
1825
/// or if node announcement for the node was never received.
You can’t perform that action at this time.
0 commit comments