X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FChannelConfig.java;h=5af68d383c2fefab17e063aa3d816a4202eacb99;hb=9e8763c71cd61d55be7c869d973524f75209a3f3;hp=6ac3d712a02d37ed2c36f480d1d32ef84a4585d7;hpb=110f2f104ba8fc34caa7e34e04737f36f064b050;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ChannelConfig.java b/src/main/java/org/ldk/structs/ChannelConfig.java index 6ac3d712..5af68d38 100644 --- a/src/main/java/org/ldk/structs/ChannelConfig.java +++ b/src/main/java/org/ldk/structs/ChannelConfig.java @@ -11,14 +11,7 @@ public class ChannelConfig extends CommonBase { @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { super.finalize(); - bindings.ChannelConfig_free(ptr); - } - - public static ChannelConfig constructor_clone(ChannelConfig orig) { - long ret = bindings.ChannelConfig_clone(orig == null ? 0 : orig.ptr & ~1); - ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); - ret_hu_conv.ptrs_to.add(orig); - return ret_hu_conv; + if (ptr != 0) { bindings.ChannelConfig_free(ptr); } } public int get_fee_proportional_millionths() { @@ -51,24 +44,32 @@ public class ChannelConfig extends CommonBase { public static ChannelConfig constructor_new(int fee_proportional_millionths_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg) { long ret = bindings.ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg); ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); + return ret_hu_conv; + } + + public ChannelConfig clone() { + long ret = bindings.ChannelConfig_clone(this.ptr); + ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); + ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } public static ChannelConfig constructor_default() { long ret = bindings.ChannelConfig_default(); ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } - public byte[] write(ChannelConfig obj) { - byte[] ret = bindings.ChannelConfig_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.ChannelConfig_write(this.ptr); return ret; } - public static ChannelConfig constructor_read(byte[] ser) { + public static Result_ChannelConfigDecodeErrorZ constructor_read(byte[] ser) { long ret = bindings.ChannelConfig_read(ser); - ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); + Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }