X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FExpiryTime.java;h=5c916db30952de57911e1ca5e4dd87f0bc383caa;hb=4a36fa97d4eee96099c4a176ea845c52db27e64c;hp=671e298016ae89926e69f0276045487fa2a5e090;hpb=13cdf8bde340072288b39a5e29f0946d3e095ad4;p=ldk-java diff --git a/src/main/java/org/ldk/structs/ExpiryTime.java b/src/main/java/org/ldk/structs/ExpiryTime.java index 671e2980..5c916db3 100644 --- a/src/main/java/org/ldk/structs/ExpiryTime.java +++ b/src/main/java/org/ldk/structs/ExpiryTime.java @@ -35,12 +35,12 @@ public class ExpiryTime extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ExpiryTime(null, ret); } - ret_hu_conv.ptrs_to.add(this); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; } /** - * Checks if two ExpiryTimes contain equal inner contents. + * Generates a non-cryptographic 64-bit hash of the ExpiryTime. */ public long hash() { long ret = bindings.ExpiryTime_hash(this.ptr); @@ -56,11 +56,11 @@ public class ExpiryTime extends CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. * Two objects with NULL inner values will be considered "equal" here. */ - public boolean eq(ExpiryTime b) { + public boolean eq(org.ldk.structs.ExpiryTime b) { boolean ret = bindings.ExpiryTime_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); - this.ptrs_to.add(b); + if (this != null) { this.ptrs_to.add(b); }; return ret; } @@ -76,19 +76,19 @@ public class ExpiryTime extends CommonBase { Reference.reachabilityFence(seconds); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ExpiryTime(null, ret); } - ret_hu_conv.ptrs_to.add(ret_hu_conv); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } /** - * Construct an `ExpiryTime` from a `Duration`. + * Construct an `ExpiryTime` from a [`Duration`], dropping the sub-second part. */ public static ExpiryTime from_duration(long duration) { long ret = bindings.ExpiryTime_from_duration(duration); Reference.reachabilityFence(duration); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ExpiryTime(null, ret); } - ret_hu_conv.ptrs_to.add(ret_hu_conv); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } @@ -102,7 +102,7 @@ public class ExpiryTime extends CommonBase { } /** - * Returns a reference to the underlying `Duration` (=expiry time) + * Returns a reference to the underlying [`Duration`] (=expiry time) */ public long as_duration() { long ret = bindings.ExpiryTime_as_duration(this.ptr);