X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FHTLCUpdate.java;h=f860f5dd8d464efbb8c23af4ee182f3a0d4d12ae;hb=fed2245c60159f6c074c9ed5c0f3ce273ad9841b;hp=008ca802d19095baad392c0ddb168220adee456e;hpb=110f2f104ba8fc34caa7e34e04737f36f064b050;p=ldk-java diff --git a/src/main/java/org/ldk/structs/HTLCUpdate.java b/src/main/java/org/ldk/structs/HTLCUpdate.java index 008ca802..f860f5dd 100644 --- a/src/main/java/org/ldk/structs/HTLCUpdate.java +++ b/src/main/java/org/ldk/structs/HTLCUpdate.java @@ -11,25 +11,25 @@ public class HTLCUpdate extends CommonBase { @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { super.finalize(); - bindings.HTLCUpdate_free(ptr); + if (ptr != 0) { bindings.HTLCUpdate_free(ptr); } } - public static HTLCUpdate constructor_clone(HTLCUpdate orig) { - long ret = bindings.HTLCUpdate_clone(orig == null ? 0 : orig.ptr & ~1); + public HTLCUpdate clone() { + long ret = bindings.HTLCUpdate_clone(this.ptr); HTLCUpdate ret_hu_conv = new HTLCUpdate(null, ret); - ret_hu_conv.ptrs_to.add(orig); + ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } - public byte[] write(HTLCUpdate obj) { - byte[] ret = bindings.HTLCUpdate_write(obj == null ? 0 : obj.ptr & ~1); - this.ptrs_to.add(obj); + public byte[] write() { + byte[] ret = bindings.HTLCUpdate_write(this.ptr); return ret; } public static HTLCUpdate constructor_read(byte[] ser) { long ret = bindings.HTLCUpdate_read(ser); HTLCUpdate ret_hu_conv = new HTLCUpdate(null, ret); + ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; }