X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FChannelHandshakeConfig.java;h=730d50adb2618cd4932ad8ab51c166fa574003d1;hb=9e8763c71cd61d55be7c869d973524f75209a3f3;hp=33cf8e719b5e909630d10e2a995d10c3013734ef;hpb=110f2f104ba8fc34caa7e34e04737f36f064b050;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java b/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java index 33cf8e71..730d50ad 100644 --- a/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java +++ b/src/main/java/org/ldk/structs/ChannelHandshakeConfig.java @@ -11,14 +11,7 @@ public class ChannelHandshakeConfig extends CommonBase { @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { super.finalize(); - bindings.ChannelHandshakeConfig_free(ptr); - } - - public static ChannelHandshakeConfig constructor_clone(ChannelHandshakeConfig orig) { - long ret = bindings.ChannelHandshakeConfig_clone(orig == null ? 0 : orig.ptr & ~1); - ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); - ret_hu_conv.ptrs_to.add(orig); - return ret_hu_conv; + if (ptr != 0) { bindings.ChannelHandshakeConfig_free(ptr); } } public int get_minimum_depth() { @@ -51,12 +44,21 @@ public class ChannelHandshakeConfig extends CommonBase { public static ChannelHandshakeConfig constructor_new(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg) { long ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg); ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public ChannelHandshakeConfig clone() { + long ret = bindings.ChannelHandshakeConfig_clone(this.ptr); + ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); + ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } public static ChannelHandshakeConfig constructor_default() { long ret = bindings.ChannelHandshakeConfig_default(); ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; }