X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FUpdateFailHTLC.java;h=4878f34054131f29d1b05fece4f271f3df09a8fc;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=f558b4f95a5ea356569bbfdc268974ac8df2a644;hpb=1b870a3ffab1c0024411e30102bc6d198300f095;p=ldk-java diff --git a/src/main/java/org/ldk/structs/UpdateFailHTLC.java b/src/main/java/org/ldk/structs/UpdateFailHTLC.java index f558b4f9..4878f340 100644 --- a/src/main/java/org/ldk/structs/UpdateFailHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFailHTLC.java @@ -4,6 +4,7 @@ import org.ldk.impl.bindings; import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +import javax.annotation.Nullable; /** @@ -30,7 +31,7 @@ public class UpdateFailHTLC extends CommonBase { * The channel ID */ public void set_channel_id(byte[] val) { - bindings.UpdateFailHTLC_set_channel_id(this.ptr, val); + bindings.UpdateFailHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -48,12 +49,18 @@ public class UpdateFailHTLC extends CommonBase { bindings.UpdateFailHTLC_set_htlc_id(this.ptr, val); } + long clone_ptr() { + long ret = bindings.UpdateFailHTLC_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the UpdateFailHTLC */ public UpdateFailHTLC clone() { long ret = bindings.UpdateFailHTLC_clone(this.ptr); - UpdateFailHTLC ret_hu_conv = new UpdateFailHTLC(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + UpdateFailHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFailHTLC(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -69,8 +76,9 @@ public class UpdateFailHTLC extends CommonBase { /** * Read a UpdateFailHTLC from a byte array, created by UpdateFailHTLC_write */ - public static Result_UpdateFailHTLCDecodeErrorZ constructor_read(byte[] ser) { + public static Result_UpdateFailHTLCDecodeErrorZ read(byte[] ser) { long ret = bindings.UpdateFailHTLC_read(ser); + if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }