X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fldk%2Fstructs%2FBolt11Invoice.java;h=67e9f44beb63214e2efeffc44eb4ae598707907e;hb=ffdd56c967087cba7548599934585b8a9a3102e2;hp=fa48c2ffaf25e0f06c35c766bb2ebb0c33bd839b;hpb=3e33cfde4213dafe90eb976eb67224e2451da855;p=ldk-java diff --git a/src/main/java/org/ldk/structs/Bolt11Invoice.java b/src/main/java/org/ldk/structs/Bolt11Invoice.java index fa48c2ff..67e9f44b 100644 --- a/src/main/java/org/ldk/structs/Bolt11Invoice.java +++ b/src/main/java/org/ldk/structs/Bolt11Invoice.java @@ -33,7 +33,7 @@ public class Bolt11Invoice extends CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public boolean eq(org.ldk.structs.Bolt11Invoice b) { - boolean ret = bindings.Bolt11Invoice_eq(this.ptr, b == null ? 0 : b.ptr); + boolean ret = bindings.Bolt11Invoice_eq(this.ptr, b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); if (this != null) { this.ptrs_to.add(b); }; @@ -130,7 +130,7 @@ public class Bolt11Invoice extends CommonBase { * ``` */ public static Result_Bolt11InvoiceBolt11SemanticErrorZ from_signed(org.ldk.structs.SignedRawBolt11Invoice signed_invoice) { - long ret = bindings.Bolt11Invoice_from_signed(signed_invoice == null ? 0 : signed_invoice.ptr); + long ret = bindings.Bolt11Invoice_from_signed(signed_invoice.ptr); Reference.reachabilityFence(signed_invoice); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceBolt11SemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceBolt11SemanticErrorZ.constr_from_ptr(ret); @@ -222,15 +222,25 @@ public class Bolt11Invoice extends CommonBase { return ret; } + /** + * Recover the payee's public key if one was included in the invoice, otherwise return the + * recovered public key from the signature + */ + public byte[] get_payee_pub_key() { + byte[] ret = bindings.Bolt11Invoice_get_payee_pub_key(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + /** * Returns the Duration since the Unix epoch at which the invoice expires. * Returning None if overflow occurred. */ - public Option_DurationZ expires_at() { + public Option_u64Z expires_at() { long ret = bindings.Bolt11Invoice_expires_at(this.ptr); Reference.reachabilityFence(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_DurationZ ret_hu_conv = org.ldk.structs.Option_DurationZ.constr_from_ptr(ret); + org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; return ret_hu_conv; }