Bindings updates
[ldk-java] / src / main / java / org / ldk / structs / UpdateAddHTLC.java
index 7e33edf0a6c90251affea97b6fa9e66f5b055723..3f6643ce839b413362c4c0094b3ab5bb552b40f2 100644 (file)
@@ -11,13 +11,13 @@ public class UpdateAddHTLC extends CommonBase {
        @Override @SuppressWarnings("deprecation")
        protected void finalize() throws Throwable {
                super.finalize();
-               bindings.UpdateAddHTLC_free(ptr);
+               if (ptr != 0) { bindings.UpdateAddHTLC_free(ptr); }
        }
 
-       public static UpdateAddHTLC constructor_clone(UpdateAddHTLC orig) {
-               long ret = bindings.UpdateAddHTLC_clone(orig == null ? 0 : orig.ptr & ~1);
+       public UpdateAddHTLC clone() {
+               long ret = bindings.UpdateAddHTLC_clone(this.ptr);
                UpdateAddHTLC ret_hu_conv = new UpdateAddHTLC(null, ret);
-               ret_hu_conv.ptrs_to.add(orig);
+               ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
 
@@ -66,15 +66,15 @@ public class UpdateAddHTLC extends CommonBase {
                bindings.UpdateAddHTLC_set_cltv_expiry(this.ptr, val);
        }
 
-       public byte[] write(UpdateAddHTLC obj) {
-               byte[] ret = bindings.UpdateAddHTLC_write(obj == null ? 0 : obj.ptr & ~1);
-               this.ptrs_to.add(obj);
+       public byte[] write() {
+               byte[] ret = bindings.UpdateAddHTLC_write(this.ptr);
                return ret;
        }
 
        public static UpdateAddHTLC constructor_read(byte[] ser) {
                long ret = bindings.UpdateAddHTLC_read(ser);
                UpdateAddHTLC ret_hu_conv = new UpdateAddHTLC(null, ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
        }