X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=inline;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FSha256.java;h=6daa4ecd23c7c2b2596373719d5fdab9613f5e58;hb=3c60e0fd0da579be9932801c1be2b32014c944a5;hp=4112c44f0b4ae49774bd874d4b6cf352ffbd5697;hpb=47341beaeecf907f422f126500baf586d54a0d41;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Sha256.java b/src/main/java/org/ldk/structs/Sha256.java index 4112c44f..6daa4ecd 100644 --- a/src/main/java/org/ldk/structs/Sha256.java +++ b/src/main/java/org/ldk/structs/Sha256.java @@ -34,7 +34,7 @@ public class Sha256 extends CommonBase { Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sha256(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; } @@ -56,10 +56,10 @@ public class Sha256 extends CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public boolean eq(Sha256 b) { - boolean ret = bindings.Sha256_eq(this.ptr, b == null ? 0 : b.ptr & ~1); + boolean ret = bindings.Sha256_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; }