X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FReadOnlyNetworkGraph.java;h=d95374dae145d04d1284bab846618467ad70cd3c;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=ac1069d55cd6165c4a087b3ada7bcac779c85725;hpb=a7653cf8717b1f9df4d3f4c4bd0b1f50f3bbc230;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java b/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java index ac1069d5..d95374da 100644 --- a/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java +++ b/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java @@ -19,4 +19,17 @@ public class ReadOnlyNetworkGraph extends CommonBase { if (ptr != 0) { bindings.ReadOnlyNetworkGraph_free(ptr); } } + /** + * 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. + */ + public Option_CVec_NetAddressZZ get_addresses(byte[] pubkey) { + long ret = bindings.ReadOnlyNetworkGraph_get_addresses(this.ptr, pubkey); + if (ret >= 0 && ret <= 4096) { return null; } + Option_CVec_NetAddressZZ ret_hu_conv = Option_CVec_NetAddressZZ.constr_from_ptr(ret); + ret_hu_conv.ptrs_to.add(this); + return ret_hu_conv; + } + }