X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FChannelReady.java;h=95364b2ca77f32354ce9b2c8319d01e95f50654b;hb=125fdf2b7111945df72dd4ee73f98bedccdd64c4;hp=8a78bdeab6a87fcba580bfb93391ee83d1fdfe3e;hpb=239d70ea23fdf148440dfedf9479944dc0fbf394;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ChannelReady.java b/src/main/java/org/ldk/structs/ChannelReady.java index 8a78bdea..95364b2c 100644 --- a/src/main/java/org/ldk/structs/ChannelReady.java +++ b/src/main/java/org/ldk/structs/ChannelReady.java @@ -25,19 +25,23 @@ public class ChannelReady extends CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { - byte[] ret = bindings.ChannelReady_get_channel_id(this.ptr); + public ChannelId get_channel_id() { + long ret = bindings.ChannelReady_get_channel_id(this.ptr); Reference.reachabilityFence(this); - return ret; + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.ChannelReady_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.ChannelReady_set_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); + if (this != null) { this.ptrs_to.add(val); }; } /** @@ -89,14 +93,15 @@ public class ChannelReady extends CommonBase { /** * Constructs a new ChannelReady given each field */ - public static ChannelReady of(byte[] channel_id_arg, byte[] next_per_commitment_point_arg, org.ldk.structs.Option_u64Z short_channel_id_alias_arg) { - long ret = bindings.ChannelReady_new(InternalUtils.check_arr_len(channel_id_arg, 32), InternalUtils.check_arr_len(next_per_commitment_point_arg, 33), short_channel_id_alias_arg.ptr); + public static ChannelReady of(org.ldk.structs.ChannelId channel_id_arg, byte[] next_per_commitment_point_arg, org.ldk.structs.Option_u64Z short_channel_id_alias_arg) { + long ret = bindings.ChannelReady_new(channel_id_arg.ptr, InternalUtils.check_arr_len(next_per_commitment_point_arg, 33), short_channel_id_alias_arg.ptr); Reference.reachabilityFence(channel_id_arg); Reference.reachabilityFence(next_per_commitment_point_arg); Reference.reachabilityFence(short_channel_id_alias_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelReady ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelReady(null, ret); } 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(channel_id_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(short_channel_id_alias_arg); }; return ret_hu_conv; } @@ -137,7 +142,7 @@ public class ChannelReady extends CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public boolean eq(org.ldk.structs.ChannelReady b) { - boolean ret = bindings.ChannelReady_eq(this.ptr, b == null ? 0 : b.ptr); + boolean ret = bindings.ChannelReady_eq(this.ptr, b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); if (this != null) { this.ptrs_to.add(b); };