X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FPositiveTimestamp.java;h=5c5e22723c907492084b96385480a1116dfe3f22;hb=c6bac88847b7c09560af81f00ba8dd3c2ebe3a19;hp=2a5af0914ed7b26972027ff48981b615fbff908b;hpb=b6cc0960eaee5a5bbc7fde79a56152d6dcd649d8;p=ldk-java diff --git a/src/main/java/org/ldk/structs/PositiveTimestamp.java b/src/main/java/org/ldk/structs/PositiveTimestamp.java index 2a5af091..5c5e2272 100644 --- a/src/main/java/org/ldk/structs/PositiveTimestamp.java +++ b/src/main/java/org/ldk/structs/PositiveTimestamp.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; /** @@ -39,7 +40,8 @@ public class PositiveTimestamp extends CommonBase { */ public PositiveTimestamp clone() { long ret = bindings.PositiveTimestamp_clone(this.ptr); - PositiveTimestamp ret_hu_conv = new PositiveTimestamp(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + PositiveTimestamp ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PositiveTimestamp(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -51,6 +53,7 @@ public class PositiveTimestamp extends CommonBase { */ public static Result_PositiveTimestampCreationErrorZ from_unix_timestamp(long unix_seconds) { long ret = bindings.PositiveTimestamp_from_unix_timestamp(unix_seconds); + if (ret >= 0 && ret <= 4096) { return null; } Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -62,6 +65,7 @@ public class PositiveTimestamp extends CommonBase { */ public static Result_PositiveTimestampCreationErrorZ from_system_time(long time) { long ret = bindings.PositiveTimestamp_from_system_time(time); + if (ret >= 0 && ret <= 4096) { return null; } Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret); return ret_hu_conv; }