X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FInvoice.java;h=ca8e9c85d7230adde7d10111e5e6e08260974479;hb=32692e00046b7ec16b6a2e20bd54800b2b48d4c0;hp=e162d340d5d467490b3e9a402c805286c0a56ac2;hpb=a7653cf8717b1f9df4d3f4c4bd0b1f50f3bbc230;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Invoice.java b/src/main/java/org/ldk/structs/Invoice.java index e162d340..ca8e9c85 100644 --- a/src/main/java/org/ldk/structs/Invoice.java +++ b/src/main/java/org/ldk/structs/Invoice.java @@ -40,7 +40,7 @@ public class Invoice extends CommonBase { */ public Invoice clone() { long ret = bindings.Invoice_clone(this.ptr); - if (ret < 1024) { return null; } + if (ret >= 0 && ret < 1024) { return null; } Invoice ret_hu_conv = new Invoice(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -51,10 +51,10 @@ public class Invoice extends CommonBase { */ public SignedRawInvoice into_signed_raw() { long ret = bindings.Invoice_into_signed_raw(this.ptr); - if (ret < 1024) { return null; } + if (ret >= 0 && ret < 1024) { return null; } SignedRawInvoice ret_hu_conv = new SignedRawInvoice(null, ret); ret_hu_conv.ptrs_to.add(this); - this.ptrs_to.add(this); + ; return ret_hu_conv; } @@ -63,7 +63,7 @@ public class Invoice extends CommonBase { */ public Result_NoneSemanticErrorZ check_signature() { long ret = bindings.Invoice_check_signature(this.ptr); - if (ret < 1024) { return null; } + if (ret >= 0 && ret < 1024) { return null; } Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret); return ret_hu_conv; } @@ -92,9 +92,8 @@ public class Invoice extends CommonBase { */ public static Result_InvoiceSemanticErrorZ from_signed(SignedRawInvoice signed_invoice) { long ret = bindings.Invoice_from_signed(signed_invoice == null ? 0 : signed_invoice.ptr & ~1); - if (ret < 1024) { return null; } + if (ret >= 0 && ret < 1024) { return null; } Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret); - ret_hu_conv.ptrs_to.add(signed_invoice); return ret_hu_conv; } @@ -141,7 +140,7 @@ public class Invoice extends CommonBase { @Nullable public InvoiceFeatures features() { long ret = bindings.Invoice_features(this.ptr); - if (ret < 1024) { return null; } + if (ret >= 0 && ret < 1024) { return null; } InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -215,7 +214,7 @@ public class Invoice extends CommonBase { */ public Option_u64Z amount_pico_btc() { long ret = bindings.Invoice_amount_pico_btc(this.ptr); - if (ret < 1024) { return null; } + if (ret >= 0 && ret < 1024) { return null; } Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -226,7 +225,7 @@ public class Invoice extends CommonBase { */ public static Result_InvoiceNoneZ from_str(java.lang.String s) { long ret = bindings.Invoice_from_str(s); - if (ret < 1024) { return null; } + if (ret >= 0 && ret < 1024) { return null; } Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret); return ret_hu_conv; }