X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=lightning-c-bindings%2Fsrc%2Fchain%2Fchaininterface.rs;h=f14123df9a6844068b56bdecfe4bc31a9cd266eb;hb=05fd5718232e2aa9581a51cdace2c0642ea533a5;hp=b5f51032326edc1cac5ae8b0e763c4d4e9b82082;hpb=1495575b517c90da925698da14f627bf0d5b313f;p=ldk-c-bindings diff --git a/lightning-c-bindings/src/chain/chaininterface.rs b/lightning-c-bindings/src/chain/chaininterface.rs index b5f5103..f14123d 100644 --- a/lightning-c-bindings/src/chain/chaininterface.rs +++ b/lightning-c-bindings/src/chain/chaininterface.rs @@ -1,3 +1,11 @@ +// This file is Copyright its original authors, visible in version control +// history and in the source files from which this was generated. +// +// This file is licensed under the license available in the LICENSE or LICENSE.md +// file in the root of this repository or, if no such file exists, the same +// license as that which applies to the original source files from which this +// source was automatically generated. + //! Traits and utility impls which allow other parts of rust-lightning to interact with the //! blockchain. //! @@ -11,9 +19,13 @@ use crate::c_types::*; /// An interface to send a transaction to the Bitcoin network. #[repr(C)] pub struct BroadcasterInterface { + /// An opaque pointer which is passed to your function implementations as an argument. + /// This has no meaning in the LDK, and can be NULL or any other value. pub this_arg: *mut c_void, /// Sends a transaction out to (hopefully) be mined. pub broadcast_transaction: extern "C" fn (this_arg: *const c_void, tx: crate::c_types::Transaction), + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } unsafe impl Sync for BroadcasterInterface {} @@ -93,6 +105,7 @@ impl ConfirmationTarget { } } } +/// Creates a copy of the ConfirmationTarget #[no_mangle] pub extern "C" fn ConfirmationTarget_clone(orig: &ConfirmationTarget) -> ConfirmationTarget { orig.clone() @@ -104,6 +117,8 @@ pub extern "C" fn ConfirmationTarget_clone(orig: &ConfirmationTarget) -> Confirm /// called from inside the library in response to chain events, P2P events, or timer events). #[repr(C)] pub struct FeeEstimator { + /// An opaque pointer which is passed to your function implementations as an argument. + /// This has no meaning in the LDK, and can be NULL or any other value. pub this_arg: *mut c_void, /// Gets estimated satoshis of fee required per 1000 Weight-Units. /// @@ -115,6 +130,8 @@ pub struct FeeEstimator { /// * ceil(satoshis-per-kbyte / 4) #[must_use] pub get_est_sat_per_1000_weight: extern "C" fn (this_arg: *const c_void, confirmation_target: crate::chain::chaininterface::ConfirmationTarget) -> u32, + /// Frees any resources associated with this object given its this_arg pointer. + /// Does not need to free the outer struct containing function pointers and may be NULL is no resources need to be freed. pub free: Option, } unsafe impl Sync for FeeEstimator {} @@ -146,6 +163,7 @@ impl Drop for FeeEstimator { } } } +/// Minimum relay fee as required by bitcoin network mempool policy. #[no_mangle] pub static MIN_RELAY_FEE_SAT_PER_1000_WEIGHT: u64 = lightning::chain::chaininterface::MIN_RELAY_FEE_SAT_PER_1000_WEIGHT;