X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FTwoTuple_PaymentHashPaymentIdZ.java;h=0f95e54345cc924b8a1e24f85c926db88ac13b2e;hb=1854b5cebef22ace9e9e4dd191f609818df9ce08;hp=3d8845b219d606a65accabf660e95895833e8046;hpb=0e5e33e2bb46c905f6c9478fbfcda11be6b309ff;p=ldk-java diff --git a/src/main/java/org/ldk/structs/TwoTuple_PaymentHashPaymentIdZ.java b/src/main/java/org/ldk/structs/TwoTuple_PaymentHashPaymentIdZ.java index 3d8845b2..0f95e543 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_PaymentHashPaymentIdZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_PaymentHashPaymentIdZ.java @@ -4,6 +4,7 @@ import org.ldk.impl.bindings; import org.ldk.enums.*; import org.ldk.util.*; import java.util.Arrays; +import java.lang.ref.Reference; import javax.annotation.Nullable; @@ -24,18 +25,23 @@ public class TwoTuple_PaymentHashPaymentIdZ extends CommonBase { */ public byte[] get_a() { byte[] ret = bindings.C2Tuple_PaymentHashPaymentIdZ_get_a(this.ptr); + Reference.reachabilityFence(this); return ret; } /** * */ - public PaymentId get_b() { - long ret = bindings.C2Tuple_PaymentHashPaymentIdZ_get_b(this.ptr); - if (ret >= 0 && ret < 1024) { return null; } - PaymentId ret_hu_conv = new PaymentId(null, ret); - ret_hu_conv.ptrs_to.add(this); - return ret_hu_conv; + public byte[] get_b() { + byte[] ret = bindings.C2Tuple_PaymentHashPaymentIdZ_get_b(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.C2Tuple_PaymentHashPaymentIdZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; } /** @@ -44,7 +50,8 @@ public class TwoTuple_PaymentHashPaymentIdZ extends CommonBase { */ public TwoTuple_PaymentHashPaymentIdZ clone() { long ret = bindings.C2Tuple_PaymentHashPaymentIdZ_clone(this.ptr); - if (ret >= 0 && ret < 1024) { return null; } + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_PaymentHashPaymentIdZ ret_hu_conv = new TwoTuple_PaymentHashPaymentIdZ(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -53,9 +60,11 @@ public class TwoTuple_PaymentHashPaymentIdZ extends CommonBase { /** * Creates a new C2Tuple_PaymentHashPaymentIdZ from the contained elements. */ - public static TwoTuple_PaymentHashPaymentIdZ of(byte[] a, PaymentId b) { - long ret = bindings.C2Tuple_PaymentHashPaymentIdZ_new(a, b == null ? 0 : b.ptr & ~1); - if (ret >= 0 && ret < 1024) { return null; } + public static TwoTuple_PaymentHashPaymentIdZ of(byte[] a, byte[] b) { + long ret = bindings.C2Tuple_PaymentHashPaymentIdZ_new(InternalUtils.check_arr_len(a, 32), InternalUtils.check_arr_len(b, 32)); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } TwoTuple_PaymentHashPaymentIdZ ret_hu_conv = new TwoTuple_PaymentHashPaymentIdZ(null, ret); ret_hu_conv.ptrs_to.add(ret_hu_conv); return ret_hu_conv;