X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=inline;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FUpdateFailHTLC.java;h=50147508fdcd19a2fc6f618437ef4c2f19f93aff;hb=ad15b3a4dbf3fbc7f08ef22d656bae79e8182008;hp=4243363881c6fb6403ad69f61f4760dd563d94c7;hpb=3d559f3266fde7c6a21248c10d9a7145125b5e69;p=ldk-java diff --git a/src/main/java/org/ldk/structs/UpdateFailHTLC.java b/src/main/java/org/ldk/structs/UpdateFailHTLC.java index 42433638..50147508 100644 --- a/src/main/java/org/ldk/structs/UpdateFailHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFailHTLC.java @@ -7,36 +7,40 @@ public class UpdateFailHTLC extends CommonBase { UpdateFailHTLC(Object _dummy, long ptr) { super(ptr); } @Override @SuppressWarnings("deprecation") protected void finalize() throws Throwable { - bindings.UpdateFailHTLC_free(ptr); super.finalize(); + super.finalize(); + bindings.UpdateFailHTLC_free(ptr); } public UpdateFailHTLC(UpdateFailHTLC orig) { - super(bindings.UpdateFailHTLC_clone(orig.ptr & ~1)); + super(bindings.UpdateFailHTLC_clone(orig == null ? 0 : orig.ptr & ~1)); this.ptrs_to.add(orig); } public byte[] get_channel_id(UpdateFailHTLC this_ptr) { - byte[] ret = bindings.UpdateFailHTLC_get_channel_id(this_ptr.ptr & ~1); + byte[] ret = bindings.UpdateFailHTLC_get_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_channel_id(UpdateFailHTLC this_ptr, byte[] val) { - bindings.UpdateFailHTLC_set_channel_id(this_ptr.ptr & ~1, val); + bindings.UpdateFailHTLC_set_channel_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } public long get_htlc_id(UpdateFailHTLC this_ptr) { - long ret = bindings.UpdateFailHTLC_get_htlc_id(this_ptr.ptr & ~1); + long ret = bindings.UpdateFailHTLC_get_htlc_id(this_ptr == null ? 0 : this_ptr.ptr & ~1); this.ptrs_to.add(this_ptr); return ret; } public void set_htlc_id(UpdateFailHTLC this_ptr, long val) { - bindings.UpdateFailHTLC_set_htlc_id(this_ptr.ptr & ~1, val); + bindings.UpdateFailHTLC_set_htlc_id(this_ptr == null ? 0 : this_ptr.ptr & ~1, val); this.ptrs_to.add(this_ptr); } // Skipped UpdateFailHTLC_write - // Skipped UpdateFailHTLC_read + public UpdateFailHTLC(byte[] ser) { + super(bindings.UpdateFailHTLC_read(ser)); + } + }