X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=inline;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FChannelInfo.java;h=db9f3589bac668671062d87ce8f165f48b7d6f05;hb=f385eff0dd0aa61fbf21ae946c424f4a6a26de04;hp=fa2ca7cf6411499cfb70b7468db89db43909b4fe;hpb=47341beaeecf907f422f126500baf586d54a0d41;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ChannelInfo.java b/src/main/java/org/ldk/structs/ChannelInfo.java index fa2ca7cf..db9f3589 100644 --- a/src/main/java/org/ldk/structs/ChannelInfo.java +++ b/src/main/java/org/ldk/structs/ChannelInfo.java @@ -29,7 +29,7 @@ public class ChannelInfo extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelFeatures(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; } @@ -37,9 +37,10 @@ public class ChannelInfo extends CommonBase { * Protocol features of a channel communicated during its announcement */ public void set_features(ChannelFeatures val) { - bindings.ChannelInfo_set_features(this.ptr, val == null ? 0 : val.ptr & ~1); + bindings.ChannelInfo_set_features(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); + if (this != null) { this.ptrs_to.add(val); }; } /** @@ -50,7 +51,7 @@ public class ChannelInfo extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(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; } @@ -58,9 +59,10 @@ public class ChannelInfo extends CommonBase { * Source node of the first direction of a channel */ public void set_node_one(NodeId val) { - bindings.ChannelInfo_set_node_one(this.ptr, val == null ? 0 : val.ptr & ~1); + bindings.ChannelInfo_set_node_one(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); + if (this != null) { this.ptrs_to.add(val); }; } /** @@ -74,7 +76,7 @@ public class ChannelInfo extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(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; } @@ -84,9 +86,10 @@ public class ChannelInfo extends CommonBase { * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ public void set_one_to_two(@Nullable ChannelUpdateInfo val) { - bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr & ~1); + bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); + if (this != null) { this.ptrs_to.add(val); }; } /** @@ -97,7 +100,7 @@ public class ChannelInfo extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(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; } @@ -105,9 +108,10 @@ public class ChannelInfo extends CommonBase { * Source node of the second direction of a channel */ public void set_node_two(NodeId val) { - bindings.ChannelInfo_set_node_two(this.ptr, val == null ? 0 : val.ptr & ~1); + bindings.ChannelInfo_set_node_two(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); + if (this != null) { this.ptrs_to.add(val); }; } /** @@ -121,7 +125,7 @@ public class ChannelInfo extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(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; } @@ -131,9 +135,10 @@ public class ChannelInfo extends CommonBase { * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ public void set_two_to_one(@Nullable ChannelUpdateInfo val) { - bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr & ~1); + bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); + if (this != null) { this.ptrs_to.add(val); }; } /** @@ -144,7 +149,7 @@ public class ChannelInfo extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.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; } @@ -171,7 +176,7 @@ public class ChannelInfo extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelAnnouncement(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; } @@ -184,9 +189,10 @@ public class ChannelInfo extends CommonBase { * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ public void set_announcement_message(@Nullable ChannelAnnouncement val) { - bindings.ChannelInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1); + bindings.ChannelInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); + if (this != null) { this.ptrs_to.add(val); }; } long clone_ptr() { @@ -203,7 +209,7 @@ public class ChannelInfo extends CommonBase { Reference.reachabilityFence(this); 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; } @@ -219,7 +225,7 @@ public class ChannelInfo extends CommonBase { Reference.reachabilityFence(channel_flags); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(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; }