X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FUnsignedChannelUpdate.java;h=5779143763efe6802073b833e2843bcec4f7fdf5;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=294ca4b36522af4de74cdde043f83026ed26b14b;hpb=f8c25e52ce878136043ddc4dbfac6c6640f1d4f6;p=ldk-java diff --git a/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java b/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java index 294ca4b3..57791437 100644 --- a/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java +++ b/src/main/java/org/ldk/structs/UnsignedChannelUpdate.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 UnsignedChannelUpdate extends CommonBase { * The genesis hash of the blockchain where the channel is to be opened */ public void set_chain_hash(byte[] val) { - bindings.UnsignedChannelUpdate_set_chain_hash(this.ptr, val); + bindings.UnsignedChannelUpdate_set_chain_hash(this.ptr, InternalUtils.check_arr_len(val, 32)); } /** @@ -152,12 +153,18 @@ public class UnsignedChannelUpdate extends CommonBase { bindings.UnsignedChannelUpdate_set_fee_proportional_millionths(this.ptr, val); } + long clone_ptr() { + long ret = bindings.UnsignedChannelUpdate_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the UnsignedChannelUpdate */ public UnsignedChannelUpdate clone() { long ret = bindings.UnsignedChannelUpdate_clone(this.ptr); - UnsignedChannelUpdate ret_hu_conv = new UnsignedChannelUpdate(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + UnsignedChannelUpdate ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UnsignedChannelUpdate(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -173,8 +180,9 @@ public class UnsignedChannelUpdate extends CommonBase { /** * Read a UnsignedChannelUpdate from a byte array, created by UnsignedChannelUpdate_write */ - public static Result_UnsignedChannelUpdateDecodeErrorZ constructor_read(byte[] ser) { + public static Result_UnsignedChannelUpdateDecodeErrorZ read(byte[] ser) { long ret = bindings.UnsignedChannelUpdate_read(ser); + if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }