Bindings updates
[ldk-java] / src / main / java / org / ldk / structs / CommitmentSigned.java
index bffa91b785f967a1fc3efc11cd1633fff11395a3..e6a76bcf4f779fb732e07f2dad2ca96337153aba 100644 (file)
@@ -11,13 +11,13 @@ public class CommitmentSigned extends CommonBase {
        @Override @SuppressWarnings("deprecation")
        protected void finalize() throws Throwable {
                super.finalize();
-               bindings.CommitmentSigned_free(ptr);
+               if (ptr != 0) { bindings.CommitmentSigned_free(ptr); }
        }
 
-       public static CommitmentSigned constructor_clone(CommitmentSigned orig) {
-               long ret = bindings.CommitmentSigned_clone(orig == null ? 0 : orig.ptr & ~1);
+       public CommitmentSigned clone() {
+               long ret = bindings.CommitmentSigned_clone(this.ptr);
                CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret);
-               ret_hu_conv.ptrs_to.add(orig);
+               ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
 
@@ -46,18 +46,19 @@ public class CommitmentSigned extends CommonBase {
        public static CommitmentSigned constructor_new(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg) {
                long ret = bindings.CommitmentSigned_new(channel_id_arg, signature_arg, htlc_signatures_arg);
                CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }
 
-       public byte[] write(CommitmentSigned obj) {
-               byte[] ret = bindings.CommitmentSigned_write(obj == null ? 0 : obj.ptr & ~1);
-               this.ptrs_to.add(obj);
+       public byte[] write() {
+               byte[] ret = bindings.CommitmentSigned_write(this.ptr);
                return ret;
        }
 
        public static CommitmentSigned constructor_read(byte[] ser) {
                long ret = bindings.CommitmentSigned_read(ser);
                CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }