X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FChannelInfo.java;h=c105359680ea2a8cbc9616dd444934c611998e08;hb=32692e00046b7ec16b6a2e20bd54800b2b48d4c0;hp=9f7e5bd03432bc4166efdfb1d8beaeafe4b9d5a0;hpb=db1a11032b4164540a2d3403696be12bbca70e94;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ChannelInfo.java b/src/main/java/org/ldk/structs/ChannelInfo.java index 9f7e5bd0..c1053596 100644 --- a/src/main/java/org/ldk/structs/ChannelInfo.java +++ b/src/main/java/org/ldk/structs/ChannelInfo.java @@ -25,7 +25,7 @@ public class ChannelInfo extends CommonBase { */ public ChannelFeatures get_features() { long ret = bindings.ChannelInfo_get_features(this.ptr); - if (ret < 1024) { return null; } + if (ret >= 0 && ret < 1024) { return null; } ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -36,7 +36,6 @@ public class ChannelInfo extends CommonBase { */ public void set_features(ChannelFeatures val) { bindings.ChannelInfo_set_features(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); } /** @@ -62,7 +61,7 @@ public class ChannelInfo extends CommonBase { @Nullable public DirectionalChannelInfo get_one_to_two() { long ret = bindings.ChannelInfo_get_one_to_two(this.ptr); - if (ret < 1024) { return null; } + if (ret >= 0 && ret < 1024) { return null; } DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -75,7 +74,6 @@ public class ChannelInfo extends CommonBase { */ public void set_one_to_two(@Nullable DirectionalChannelInfo val) { bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); } /** @@ -101,7 +99,7 @@ public class ChannelInfo extends CommonBase { @Nullable public DirectionalChannelInfo get_two_to_one() { long ret = bindings.ChannelInfo_get_two_to_one(this.ptr); - if (ret < 1024) { return null; } + if (ret >= 0 && ret < 1024) { return null; } DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -114,7 +112,6 @@ public class ChannelInfo extends CommonBase { */ public void set_two_to_one(@Nullable DirectionalChannelInfo val) { bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); } /** @@ -122,7 +119,7 @@ public class ChannelInfo extends CommonBase { */ public Option_u64Z get_capacity_sats() { long ret = bindings.ChannelInfo_get_capacity_sats(this.ptr); - if (ret < 1024) { return null; } + if (ret >= 0 && ret < 1024) { return null; } Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -146,7 +143,7 @@ public class ChannelInfo extends CommonBase { @Nullable public ChannelAnnouncement get_announcement_message() { long ret = bindings.ChannelInfo_get_announcement_message(this.ptr); - if (ret < 1024) { return null; } + if (ret >= 0 && ret < 1024) { return null; } ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -162,7 +159,6 @@ public class ChannelInfo extends CommonBase { */ public void set_announcement_message(@Nullable ChannelAnnouncement val) { bindings.ChannelInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); } /** @@ -170,13 +166,9 @@ public class ChannelInfo extends CommonBase { */ public static ChannelInfo of(ChannelFeatures features_arg, byte[] node_one_arg, DirectionalChannelInfo one_to_two_arg, byte[] node_two_arg, DirectionalChannelInfo two_to_one_arg, Option_u64Z capacity_sats_arg, ChannelAnnouncement announcement_message_arg) { long ret = bindings.ChannelInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, node_one_arg, one_to_two_arg == null ? 0 : one_to_two_arg.ptr & ~1, node_two_arg, two_to_one_arg == null ? 0 : two_to_one_arg.ptr & ~1, capacity_sats_arg.ptr, announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1); - if (ret < 1024) { return null; } + if (ret >= 0 && ret < 1024) { return null; } ChannelInfo ret_hu_conv = new ChannelInfo(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); - ret_hu_conv.ptrs_to.add(features_arg); - ret_hu_conv.ptrs_to.add(one_to_two_arg); - ret_hu_conv.ptrs_to.add(two_to_one_arg); - ret_hu_conv.ptrs_to.add(announcement_message_arg); return ret_hu_conv; } @@ -185,7 +177,7 @@ public class ChannelInfo extends CommonBase { */ public ChannelInfo clone() { long ret = bindings.ChannelInfo_clone(this.ptr); - if (ret < 1024) { return null; } + if (ret >= 0 && ret < 1024) { return null; } ChannelInfo ret_hu_conv = new ChannelInfo(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -204,7 +196,7 @@ public class ChannelInfo extends CommonBase { */ public static Result_ChannelInfoDecodeErrorZ read(byte[] ser) { long ret = bindings.ChannelInfo_read(ser); - if (ret < 1024) { return null; } + if (ret >= 0 && ret < 1024) { return null; } Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }