X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FReadOnlyNetworkGraph.java;h=0271d99815099d9afcd1d4d2315a2070a485cd8d;hb=HEAD;hp=8ed45ff40720784735fb1718fed84f9441013d0c;hpb=13cdf8bde340072288b39a5e29f0946d3e095ad4;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java b/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java index 8ed45ff4..0271d998 100644 --- a/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java +++ b/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java @@ -30,7 +30,7 @@ public class ReadOnlyNetworkGraph extends CommonBase implements AutoCloseable { Reference.reachabilityFence(short_channel_id); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelInfo(null, ret); } - ret_hu_conv.ptrs_to.add(this); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } @@ -49,14 +49,14 @@ public class ReadOnlyNetworkGraph extends CommonBase implements AutoCloseable { * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ @Nullable - public NodeInfo node(NodeId node_id) { - long ret = bindings.ReadOnlyNetworkGraph_node(this.ptr, node_id == null ? 0 : node_id.ptr); + public NodeInfo node(org.ldk.structs.NodeId node_id) { + long ret = bindings.ReadOnlyNetworkGraph_node(this.ptr, node_id.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(node_id); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NodeInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeInfo(null, ret); } - ret_hu_conv.ptrs_to.add(this); - this.ptrs_to.add(node_id); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + if (this != null) { this.ptrs_to.add(node_id); }; return ret_hu_conv; } @@ -71,7 +71,7 @@ public class ReadOnlyNetworkGraph extends CommonBase implements AutoCloseable { 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); + if (ret_conv_8_hu_conv != null) { ret_conv_8_hu_conv.ptrs_to.add(this); }; ret_conv_8_arr[i] = ret_conv_8_hu_conv; } return ret_conv_8_arr; @@ -82,13 +82,13 @@ public class ReadOnlyNetworkGraph extends CommonBase implements AutoCloseable { * 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) { + public Option_CVec_SocketAddressZZ get_addresses(byte[] pubkey) { long ret = bindings.ReadOnlyNetworkGraph_get_addresses(this.ptr, InternalUtils.check_arr_len(pubkey, 33)); Reference.reachabilityFence(this); Reference.reachabilityFence(pubkey); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_CVec_NetAddressZZ ret_hu_conv = org.ldk.structs.Option_CVec_NetAddressZZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); + org.ldk.structs.Option_CVec_SocketAddressZZ ret_hu_conv = org.ldk.structs.Option_CVec_SocketAddressZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; }