X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FUserConfig.java;h=055f38fe4903ab3c6a309329e55a32c6ed5da6b6;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=3b1f2a90d87bf17a9d0e01027d2ba9357a13c54a;hpb=db1a11032b4164540a2d3403696be12bbca70e94;p=ldk-java diff --git a/src/main/java/org/ldk/structs/UserConfig.java b/src/main/java/org/ldk/structs/UserConfig.java index 3b1f2a90..055f38fe 100644 --- a/src/main/java/org/ldk/structs/UserConfig.java +++ b/src/main/java/org/ldk/structs/UserConfig.java @@ -27,8 +27,8 @@ public class UserConfig extends CommonBase { */ public ChannelHandshakeConfig get_own_channel_config() { long ret = bindings.UserConfig_get_own_channel_config(this.ptr); - if (ret < 1024) { return null; } - ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + ChannelHandshakeConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeConfig(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -38,7 +38,6 @@ public class UserConfig extends CommonBase { */ public void set_own_channel_config(ChannelHandshakeConfig val) { bindings.UserConfig_set_own_channel_config(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); } /** @@ -46,8 +45,8 @@ public class UserConfig extends CommonBase { */ public ChannelHandshakeLimits get_peer_channel_config_limits() { long ret = bindings.UserConfig_get_peer_channel_config_limits(this.ptr); - if (ret < 1024) { return null; } - ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + ChannelHandshakeLimits ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelHandshakeLimits(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -57,7 +56,6 @@ public class UserConfig extends CommonBase { */ public void set_peer_channel_config_limits(ChannelHandshakeLimits val) { bindings.UserConfig_set_peer_channel_config_limits(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); } /** @@ -65,8 +63,8 @@ public class UserConfig extends CommonBase { */ public ChannelConfig get_channel_options() { long ret = bindings.UserConfig_get_channel_options(this.ptr); - if (ret < 1024) { return null; } - ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + ChannelConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ChannelConfig(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -76,7 +74,6 @@ public class UserConfig extends CommonBase { */ public void set_channel_options(ChannelConfig val) { bindings.UserConfig_set_channel_options(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); } /** @@ -129,22 +126,24 @@ public class UserConfig extends CommonBase { */ public static UserConfig of(ChannelHandshakeConfig own_channel_config_arg, ChannelHandshakeLimits peer_channel_config_limits_arg, ChannelConfig channel_options_arg, boolean accept_forwards_to_priv_channels_arg) { long ret = bindings.UserConfig_new(own_channel_config_arg == null ? 0 : own_channel_config_arg.ptr & ~1, peer_channel_config_limits_arg == null ? 0 : peer_channel_config_limits_arg.ptr & ~1, channel_options_arg == null ? 0 : channel_options_arg.ptr & ~1, accept_forwards_to_priv_channels_arg); - if (ret < 1024) { return null; } - UserConfig ret_hu_conv = new UserConfig(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UserConfig(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); - ret_hu_conv.ptrs_to.add(own_channel_config_arg); - ret_hu_conv.ptrs_to.add(peer_channel_config_limits_arg); - ret_hu_conv.ptrs_to.add(channel_options_arg); return ret_hu_conv; } + long clone_ptr() { + long ret = bindings.UserConfig_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the UserConfig */ public UserConfig clone() { long ret = bindings.UserConfig_clone(this.ptr); - if (ret < 1024) { return null; } - UserConfig ret_hu_conv = new UserConfig(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UserConfig(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -154,8 +153,8 @@ public class UserConfig extends CommonBase { */ public static UserConfig with_default() { long ret = bindings.UserConfig_default(); - if (ret < 1024) { return null; } - UserConfig ret_hu_conv = new UserConfig(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UserConfig(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; }