X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FGossipSync.java;h=8833652199c0fc7723c297b818e6334f1bd6c856;hb=ffdd56c967087cba7548599934585b8a9a3102e2;hp=7c62cc7a2bcdd55b8e76327156e12bdea399f68e;hpb=2a8741cb87eb2b82381a6220a98f80f741147837;p=ldk-java diff --git a/src/main/java/org/ldk/structs/GossipSync.java b/src/main/java/org/ldk/structs/GossipSync.java index 7c62cc7a..88336521 100644 --- a/src/main/java/org/ldk/structs/GossipSync.java +++ b/src/main/java/org/ldk/structs/GossipSync.java @@ -42,7 +42,7 @@ public class GossipSync extends CommonBase { super(null, ptr); long p2p = obj.p2p; org.ldk.structs.P2PGossipSync p2p_hu_conv = null; if (p2p < 0 || p2p > 4096) { p2p_hu_conv = new org.ldk.structs.P2PGossipSync(null, p2p); } - p2p_hu_conv.ptrs_to.add(this); + if (p2p_hu_conv != null) { p2p_hu_conv.ptrs_to.add(this); }; this.p2p = p2p_hu_conv; } } @@ -55,7 +55,7 @@ public class GossipSync extends CommonBase { super(null, ptr); long rapid = obj.rapid; org.ldk.structs.RapidGossipSync rapid_hu_conv = null; if (rapid < 0 || rapid > 4096) { rapid_hu_conv = new org.ldk.structs.RapidGossipSync(null, rapid); } - rapid_hu_conv.ptrs_to.add(this); + if (rapid_hu_conv != null) { rapid_hu_conv.ptrs_to.add(this); }; this.rapid = rapid_hu_conv; } } @@ -70,26 +70,26 @@ public class GossipSync extends CommonBase { /** * Utility method to constructs a new P2P-variant GossipSync */ - public static GossipSync p2_p(P2PGossipSync a) { - long ret = bindings.GossipSync_p2_p(a == null ? 0 : a.ptr & ~1); + public static GossipSync p2_p(org.ldk.structs.P2PGossipSync a) { + long ret = bindings.GossipSync_p2_p(a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.GossipSync ret_hu_conv = org.ldk.structs.GossipSync.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); - ret_hu_conv.ptrs_to.add(a); + 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(a); }; return ret_hu_conv; } /** * Utility method to constructs a new Rapid-variant GossipSync */ - public static GossipSync rapid(RapidGossipSync a) { - long ret = bindings.GossipSync_rapid(a == null ? 0 : a.ptr & ~1); + public static GossipSync rapid(org.ldk.structs.RapidGossipSync a) { + long ret = bindings.GossipSync_rapid(a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.GossipSync ret_hu_conv = org.ldk.structs.GossipSync.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(ret_hu_conv); - ret_hu_conv.ptrs_to.add(a); + 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(a); }; return ret_hu_conv; } @@ -100,7 +100,7 @@ public class GossipSync extends CommonBase { long ret = bindings.GossipSync_none(); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.GossipSync ret_hu_conv = org.ldk.structs.GossipSync.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; }