X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FReadOnlyNetworkGraph.java;h=8ed45ff40720784735fb1718fed84f9441013d0c;hb=13cdf8bde340072288b39a5e29f0946d3e095ad4;hp=058daad0cd89ef630e676952d6b85dc0d6ca2780;hpb=af6f9949b19c1e8d2daac5c7a94cf14d41175f2b;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java b/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java index 058daad0..8ed45ff4 100644 --- a/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java +++ b/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java @@ -34,6 +34,15 @@ public class ReadOnlyNetworkGraph extends CommonBase implements AutoCloseable { return ret_hu_conv; } + /** + * Returns the list of channels in the graph + */ + public long[] list_channels() { + long[] ret = bindings.ReadOnlyNetworkGraph_list_channels(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Returns information on a node with the given id. * @@ -41,7 +50,7 @@ public class ReadOnlyNetworkGraph extends CommonBase implements AutoCloseable { */ @Nullable public NodeInfo node(NodeId node_id) { - long ret = bindings.ReadOnlyNetworkGraph_node(this.ptr, node_id == null ? 0 : node_id.ptr & ~1); + long ret = bindings.ReadOnlyNetworkGraph_node(this.ptr, node_id == null ? 0 : node_id.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(node_id); if (ret >= 0 && ret <= 4096) { return null; } @@ -51,6 +60,23 @@ public class ReadOnlyNetworkGraph extends CommonBase implements AutoCloseable { return ret_hu_conv; } + /** + * Returns the list of nodes in the graph + */ + public NodeId[] list_nodes() { + long[] ret = bindings.ReadOnlyNetworkGraph_list_nodes(this.ptr); + Reference.reachabilityFence(this); + int ret_conv_8_len = ret.length; + NodeId[] ret_conv_8_arr = new NodeId[ret_conv_8_len]; + for (int i = 0; i < ret_conv_8_len; i++) { + long ret_conv_8 = ret[i]; + org.ldk.structs.NodeId ret_conv_8_hu_conv = null; if (ret_conv_8 < 0 || ret_conv_8 > 4096) { ret_conv_8_hu_conv = new org.ldk.structs.NodeId(null, ret_conv_8); } + ret_conv_8_hu_conv.ptrs_to.add(this); + ret_conv_8_arr[i] = ret_conv_8_hu_conv; + } + return ret_conv_8_arr; + } + /** * Get network addresses by node id. * Returns None if the requested node is completely unknown,