X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FRawInvoice.java;h=00082036314a0709d383c0d508eefc16a4617f11;hb=f3e670e9341decac613d33fc52febf19cea32f20;hp=647bab9d8017472059f1008fa854c8b0095fd4d9;hpb=ba1af51214a8ea2de62b84cd23b6145173c71752;p=ldk-java diff --git a/src/main/java/org/ldk/structs/RawInvoice.java b/src/main/java/org/ldk/structs/RawInvoice.java index 647bab9d..00082036 100644 --- a/src/main/java/org/ldk/structs/RawInvoice.java +++ b/src/main/java/org/ldk/structs/RawInvoice.java @@ -28,8 +28,8 @@ public class RawInvoice extends CommonBase { */ public RawDataPart get_data() { long ret = bindings.RawInvoice_get_data(this.ptr); - if (ret < 1024) { return null; } - RawDataPart ret_hu_conv = new RawDataPart(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + RawDataPart ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RawDataPart(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -39,7 +39,6 @@ public class RawInvoice extends CommonBase { */ public void set_data(RawDataPart val) { bindings.RawInvoice_set_data(this.ptr, val == null ? 0 : val.ptr & ~1); - this.ptrs_to.add(val); } /** @@ -53,13 +52,18 @@ public class RawInvoice extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.RawInvoice_clone_ptr(this.ptr); + return ret; + } + /** * Creates a copy of the RawInvoice */ public RawInvoice clone() { long ret = bindings.RawInvoice_clone(this.ptr); - if (ret < 1024) { return null; } - RawInvoice ret_hu_conv = new RawInvoice(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + RawInvoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new RawInvoice(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -78,8 +82,8 @@ public class RawInvoice extends CommonBase { @Nullable public Sha256 payment_hash() { long ret = bindings.RawInvoice_payment_hash(this.ptr); - if (ret < 1024) { return null; } - Sha256 ret_hu_conv = new Sha256(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Sha256(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -90,8 +94,8 @@ public class RawInvoice extends CommonBase { @Nullable public Description description() { long ret = bindings.RawInvoice_description(this.ptr); - if (ret < 1024) { return null; } - Description ret_hu_conv = new Description(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + Description ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Description(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -102,8 +106,8 @@ public class RawInvoice extends CommonBase { @Nullable public PayeePubKey payee_pub_key() { long ret = bindings.RawInvoice_payee_pub_key(this.ptr); - if (ret < 1024) { return null; } - PayeePubKey ret_hu_conv = new PayeePubKey(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + PayeePubKey ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new PayeePubKey(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -114,8 +118,8 @@ public class RawInvoice extends CommonBase { @Nullable public Sha256 description_hash() { long ret = bindings.RawInvoice_description_hash(this.ptr); - if (ret < 1024) { return null; } - Sha256 ret_hu_conv = new Sha256(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + Sha256 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new Sha256(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -126,8 +130,8 @@ public class RawInvoice extends CommonBase { @Nullable public ExpiryTime expiry_time() { long ret = bindings.RawInvoice_expiry_time(this.ptr); - if (ret < 1024) { return null; } - ExpiryTime ret_hu_conv = new ExpiryTime(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + ExpiryTime ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new ExpiryTime(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -138,8 +142,8 @@ public class RawInvoice extends CommonBase { @Nullable public MinFinalCltvExpiry min_final_cltv_expiry() { long ret = bindings.RawInvoice_min_final_cltv_expiry(this.ptr); - if (ret < 1024) { return null; } - MinFinalCltvExpiry ret_hu_conv = new MinFinalCltvExpiry(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + MinFinalCltvExpiry ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new MinFinalCltvExpiry(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -159,8 +163,8 @@ public class RawInvoice extends CommonBase { @Nullable public InvoiceFeatures features() { long ret = bindings.RawInvoice_features(this.ptr); - if (ret < 1024) { return null; } - InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret); + if (ret >= 0 && ret <= 4096) { return null; } + InvoiceFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new InvoiceFeatures(null, ret); } ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } @@ -170,7 +174,7 @@ public class RawInvoice extends CommonBase { PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret.length]; for (int o = 0; o < ret.length; o++) { long ret_conv_14 = ret[o]; - PrivateRoute ret_conv_14_hu_conv = new PrivateRoute(null, ret_conv_14); + PrivateRoute ret_conv_14_hu_conv = null; if (ret_conv_14 < 0 || ret_conv_14 > 4096) { ret_conv_14_hu_conv = new PrivateRoute(null, ret_conv_14); } ret_conv_14_hu_conv.ptrs_to.add(this); ret_conv_14_arr[o] = ret_conv_14_hu_conv; } @@ -179,7 +183,7 @@ public class RawInvoice extends CommonBase { public Option_u64Z amount_pico_btc() { long ret = bindings.RawInvoice_amount_pico_btc(this.ptr); - if (ret < 1024) { return null; } + if (ret >= 0 && ret <= 4096) { return null; } Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv;