X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FUpdateFulfillHTLC.java;h=0b34f89869b7c4680a420611ca0670d35bc62653;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=b1b690c22f535e5da0b41cc382048120317c63b3;hpb=1b870a3ffab1c0024411e30102bc6d198300f095;p=ldk-java diff --git a/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java b/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java index b1b690c2..0b34f898 100644 --- a/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFulfillHTLC.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; /** @@ -66,9 +67,10 @@ public class UpdateFulfillHTLC extends CommonBase { /** * Constructs a new UpdateFulfillHTLC given each field */ - public static UpdateFulfillHTLC constructor_new(byte[] channel_id_arg, long htlc_id_arg, byte[] payment_preimage_arg) { + public static UpdateFulfillHTLC of(byte[] channel_id_arg, long htlc_id_arg, byte[] payment_preimage_arg) { long ret = bindings.UpdateFulfillHTLC_new(channel_id_arg, htlc_id_arg, payment_preimage_arg); - UpdateFulfillHTLC ret_hu_conv = new UpdateFulfillHTLC(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + UpdateFulfillHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFulfillHTLC(null, ret); } ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv; } @@ -78,7 +80,8 @@ public class UpdateFulfillHTLC extends CommonBase { */ public UpdateFulfillHTLC clone() { long ret = bindings.UpdateFulfillHTLC_clone(this.ptr); - UpdateFulfillHTLC ret_hu_conv = new UpdateFulfillHTLC(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + UpdateFulfillHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new UpdateFulfillHTLC(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -94,8 +97,9 @@ public class UpdateFulfillHTLC extends CommonBase { /** * Read a UpdateFulfillHTLC from a byte array, created by UpdateFulfillHTLC_write */ - public static Result_UpdateFulfillHTLCDecodeErrorZ constructor_read(byte[] ser) { + public static Result_UpdateFulfillHTLCDecodeErrorZ read(byte[] ser) { long ret = bindings.UpdateFulfillHTLC_read(ser); + if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; }