X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FNetAddress.java;h=74ccb308db826e7627c35fb2dba03d0a742e2dfd;hb=890e35a4387758c0447aab34166caa579bbf3a08;hp=2813321dc225404cd533e31abcc30a30c85f549d;hpb=8f5edad2f310a130b658e1b530fe2516724c4d99;p=ldk-java diff --git a/src/main/java/org/ldk/structs/NetAddress.java b/src/main/java/org/ldk/structs/NetAddress.java index 2813321d..74ccb308 100644 --- a/src/main/java/org/ldk/structs/NetAddress.java +++ b/src/main/java/org/ldk/structs/NetAddress.java @@ -134,7 +134,7 @@ public class NetAddress extends CommonBase { super(null, ptr); long hostname = obj.hostname; org.ldk.structs.Hostname hostname_hu_conv = null; if (hostname < 0 || hostname > 4096) { hostname_hu_conv = new org.ldk.structs.Hostname(null, hostname); } - hostname_hu_conv.ptrs_to.add(this); + if (hostname_hu_conv != null) { hostname_hu_conv.ptrs_to.add(this); }; this.hostname = hostname_hu_conv; this.port = obj.port; } @@ -153,7 +153,7 @@ public class NetAddress extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NetAddress ret_hu_conv = org.ldk.structs.NetAddress.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(this); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } @@ -166,7 +166,7 @@ public class NetAddress extends CommonBase { Reference.reachabilityFence(port); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NetAddress ret_hu_conv = org.ldk.structs.NetAddress.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } @@ -179,7 +179,7 @@ public class NetAddress extends CommonBase { Reference.reachabilityFence(port); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NetAddress ret_hu_conv = org.ldk.structs.NetAddress.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } @@ -191,7 +191,7 @@ public class NetAddress extends CommonBase { Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NetAddress ret_hu_conv = org.ldk.structs.NetAddress.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } @@ -206,7 +206,7 @@ public class NetAddress extends CommonBase { Reference.reachabilityFence(port); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NetAddress ret_hu_conv = org.ldk.structs.NetAddress.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } @@ -214,12 +214,13 @@ public class NetAddress extends CommonBase { * Utility method to constructs a new Hostname-variant NetAddress */ public static NetAddress hostname(Hostname hostname, short port) { - long ret = bindings.NetAddress_hostname(hostname == null ? 0 : hostname.ptr & ~1, port); + long ret = bindings.NetAddress_hostname(hostname == null ? 0 : hostname.ptr, port); Reference.reachabilityFence(hostname); Reference.reachabilityFence(port); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NetAddress ret_hu_conv = org.ldk.structs.NetAddress.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(hostname); }; return ret_hu_conv; }