File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1796,6 +1796,12 @@ impl ReadOnlyNetworkGraph<'_> {
17961796 self . channels . get ( & short_channel_id)
17971797 }
17981798
1799+ #[ cfg( c_bindings) ] // Non-bindings users should use `channels`
1800+ /// Returns the list of nodes in the graph
1801+ pub fn list_channels ( & self ) -> Vec < u64 > {
1802+ self . channels . keys ( ) . map ( |c| * c) . collect ( )
1803+ }
1804+
17991805 /// Returns all known nodes' public keys along with announced node info.
18001806 ///
18011807 /// (C-not exported) because we have no mapping for `BTreeMap`s
@@ -1808,6 +1814,12 @@ impl ReadOnlyNetworkGraph<'_> {
18081814 self . nodes . get ( node_id)
18091815 }
18101816
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+
18111823 /// Get network addresses by node id.
18121824 /// Returns None if the requested node is completely unknown,
18131825 /// or if node announcement for the node was never received.
You can’t perform that action at this time.
0 commit comments