X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Flightning%2Fln%2Fchannelmanager.rs;h=94bcf262dd96138e5f43a7d80a493fbec07cad26;hb=refs%2Fheads%2F0.0.99;hp=62b675e076969162474168a514915172da21496f;hpb=033f4f3b2750dcd5afc8b158d7474242b29b24f3;p=ldk-c-bindings diff --git a/lightning-c-bindings/src/lightning/ln/channelmanager.rs b/lightning-c-bindings/src/lightning/ln/channelmanager.rs index 62b675e..94bcf26 100644 --- a/lightning-c-bindings/src/lightning/ln/channelmanager.rs +++ b/lightning-c-bindings/src/lightning/ln/channelmanager.rs @@ -421,6 +421,8 @@ pub extern "C" fn ChannelDetails_set_counterparty(this_ptr: &mut ChannelDetails, /// /// Note that, if this has been set, `channel_id` will be equivalent to /// `funding_txo.unwrap().to_channel_id()`. +/// +/// Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None #[no_mangle] pub extern "C" fn ChannelDetails_get_funding_txo(this_ptr: &ChannelDetails) -> crate::lightning::chain::transaction::OutPoint { let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.funding_txo; @@ -432,6 +434,8 @@ pub extern "C" fn ChannelDetails_get_funding_txo(this_ptr: &ChannelDetails) -> c /// /// Note that, if this has been set, `channel_id` will be equivalent to /// `funding_txo.unwrap().to_channel_id()`. +/// +/// Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None #[no_mangle] pub extern "C" fn ChannelDetails_set_funding_txo(this_ptr: &mut ChannelDetails, mut val: crate::lightning::chain::transaction::OutPoint) { let mut local_val = if val.inner.is_null() { None } else { Some( { *unsafe { Box::from_raw(val.take_inner()) } }) }; @@ -889,6 +893,26 @@ pub extern "C" fn PaymentSendFailure_free(this_ptr: PaymentSendFailure) { } pub extern "C" fn PaymentSendFailure_clone(orig: &PaymentSendFailure) -> PaymentSendFailure { orig.clone() } +#[no_mangle] +/// Utility method to constructs a new ParameterError-variant PaymentSendFailure +pub extern "C" fn PaymentSendFailure_parameter_error(a: crate::lightning::util::errors::APIError) -> PaymentSendFailure { + PaymentSendFailure::ParameterError(a, ) +} +#[no_mangle] +/// Utility method to constructs a new PathParameterError-variant PaymentSendFailure +pub extern "C" fn PaymentSendFailure_path_parameter_error(a: crate::c_types::derived::CVec_CResult_NoneAPIErrorZZ) -> PaymentSendFailure { + PaymentSendFailure::PathParameterError(a, ) +} +#[no_mangle] +/// Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure +pub extern "C" fn PaymentSendFailure_all_failed_retry_safe(a: crate::c_types::derived::CVec_APIErrorZ) -> PaymentSendFailure { + PaymentSendFailure::AllFailedRetrySafe(a, ) +} +#[no_mangle] +/// Utility method to constructs a new PartialFailure-variant PaymentSendFailure +pub extern "C" fn PaymentSendFailure_partial_failure(a: crate::c_types::derived::CVec_CResult_NoneAPIErrorZZ) -> PaymentSendFailure { + PaymentSendFailure::PartialFailure(a, ) +} /// Constructs a new ChannelManager to hold several channels and route between them. /// /// This is the main \"logic hub\" for all channel-related actions, and implements @@ -933,6 +957,8 @@ pub extern "C" fn ChannelManager_get_current_default_configuration(this_arg: &Ch /// Note that we do not check if you are currently connected to the given peer. If no /// connection is available, the outbound `open_channel` message may fail to send, resulting in /// the channel eventually being silently forgotten. +/// +/// Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None #[must_use] #[no_mangle] pub extern "C" fn ChannelManager_create_channel(this_arg: &ChannelManager, mut their_network_key: crate::c_types::PublicKey, mut channel_value_satoshis: u64, mut push_msat: u64, mut user_id: u64, mut override_config: crate::lightning::util::config::UserConfig) -> crate::c_types::derived::CResult_NoneAPIErrorZ { @@ -1035,6 +1061,8 @@ pub extern "C" fn ChannelManager_force_close_all_channels(this_arg: &ChannelMana /// If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature /// bit set (either as required or as available). If multiple paths are present in the Route, /// we assume the invoice had the basic_mpp feature set. +/// +/// Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None #[must_use] #[no_mangle] pub extern "C" fn ChannelManager_send_payment(this_arg: &ChannelManager, route: &crate::lightning::routing::router::Route, mut payment_hash: crate::c_types::ThirtyTwoBytes, mut payment_secret: crate::c_types::ThirtyTwoBytes) -> crate::c_types::derived::CResult_NonePaymentSendFailureZ {