X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Flightning_invoice%2Fmod.rs;h=2a4da1270e84016f214090c6567d4fdbf2a42667;hb=9f69f2f2674e068fbee0eab22518f9916090781d;hp=4c8a964949725b44729296cd9aa44a9b3c905420;hpb=0ac4dbdb8352c898100b34f0ef8ed9cebfea7786;p=ldk-c-bindings diff --git a/lightning-c-bindings/src/lightning_invoice/mod.rs b/lightning-c-bindings/src/lightning_invoice/mod.rs index 4c8a964..2a4da12 100644 --- a/lightning-c-bindings/src/lightning_invoice/mod.rs +++ b/lightning-c-bindings/src/lightning_invoice/mod.rs @@ -2386,6 +2386,7 @@ pub extern "C" fn RawBolt11Invoice_private_routes(this_arg: &crate::lightning_in local_ret.into() } +/// Returns `None` if no amount is set or on overflow. #[must_use] #[no_mangle] pub extern "C" fn RawBolt11Invoice_amount_pico_btc(this_arg: &crate::lightning_invoice::RawBolt11Invoice) -> crate::c_types::derived::COption_u64Z { @@ -2588,6 +2589,15 @@ pub extern "C" fn Bolt11Invoice_recover_payee_pub_key(this_arg: &crate::lightnin crate::c_types::PublicKey::from_rust(&ret) } +/// Recover the payee's public key if one was included in the invoice, otherwise return the +/// recovered public key from the signature +#[must_use] +#[no_mangle] +pub extern "C" fn Bolt11Invoice_get_payee_pub_key(this_arg: &crate::lightning_invoice::Bolt11Invoice) -> crate::c_types::PublicKey { + let mut ret = unsafe { &*ObjOps::untweak_ptr(this_arg.inner) }.get_payee_pub_key(); + crate::c_types::PublicKey::from_rust(&ret) +} + /// Returns the Duration since the Unix epoch at which the invoice expires. /// Returning None if overflow occurred. #[must_use]