X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FUpdateAddHTLC.java;h=5e9e25a212872b47cfb5bdf4daf7737d691297e0;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=23448cd9de31157104dc96cdda5c93780d5f6f7e;hpb=db1a11032b4164540a2d3403696be12bbca70e94;p=ldk-java diff --git a/src/main/java/org/ldk/structs/UpdateAddHTLC.java b/src/main/java/org/ldk/structs/UpdateAddHTLC.java index 23448cd9..5e9e25a2 100644 --- a/src/main/java/org/ldk/structs/UpdateAddHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateAddHTLC.java @@ -31,7 +31,7 @@ public class UpdateAddHTLC extends CommonBase { * The channel ID */ public void set_channel_id(byte[] val) { - bindings.UpdateAddHTLC_set_channel_id(this.ptr, val); + bindings.UpdateAddHTLC_set_channel_id(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -76,7 +76,7 @@ public class UpdateAddHTLC extends CommonBase { * The payment hash, the pre-image of which controls HTLC redemption */ public void set_payment_hash(byte[] val) { - bindings.UpdateAddHTLC_set_payment_hash(this.ptr, val); + bindings.UpdateAddHTLC_set_payment_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -94,13 +94,18 @@ public class UpdateAddHTLC extends CommonBase { bindings.UpdateAddHTLC_set_cltv_expiry(this.ptr, val); } + long clone_ptr() { + long ret = bindings.UpdateAddHTLC_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the UpdateAddHTLC */ public UpdateAddHTLC clone() { long ret = bindings.UpdateAddHTLC_clone(this.ptr); - if (ret < 1024) { return null; } - UpdateAddHTLC ret_hu_conv = new UpdateAddHTLC(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + UpdateAddHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateAddHTLC(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -118,7 +123,7 @@ public class UpdateAddHTLC extends CommonBase { */ public static Result_UpdateAddHTLCDecodeErrorZ read(byte[] ser) { long ret = bindings.UpdateAddHTLC_read(ser); - if (ret < 1024) { return null; } + if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }