X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FPositiveTimestamp.java;h=3113fe775e72a2604b3fd0d5f25e8d666f353a9a;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=fea0ba8604d879fe8e7cf9a94ccc295a657e5e30;hpb=db1a11032b4164540a2d3403696be12bbca70e94;p=ldk-java diff --git a/src/main/java/org/ldk/structs/PositiveTimestamp.java b/src/main/java/org/ldk/structs/PositiveTimestamp.java index fea0ba86..3113fe77 100644 --- a/src/main/java/org/ldk/structs/PositiveTimestamp.java +++ b/src/main/java/org/ldk/structs/PositiveTimestamp.java @@ -35,13 +35,18 @@ public class PositiveTimestamp extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.PositiveTimestamp_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the PositiveTimestamp */ public PositiveTimestamp clone() { long ret = bindings.PositiveTimestamp_clone(this.ptr); - if (ret < 1024) { return null; } - 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; } @@ -53,7 +58,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 < 1024) { return null; } + if (ret >= 0 && ret <= 4096) { return null; } Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -65,7 +70,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 < 1024) { return null; } + if (ret >= 0 && ret <= 4096) { return null; } Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret); return ret_hu_conv; }