[bindings] Support exposing `bitcoin::OutPoint`s as our common type
[rust-lightning] / lightning-c-bindings / src / chain / transaction.rs
index 9d099cb6939f52a664e2d66fce645a1841ce5977..3a35c4727f937183018e304786e6cf4029c2fda4 100644 (file)
@@ -58,6 +58,10 @@ impl Clone for OutPoint {
 pub(crate) extern "C" fn OutPoint_clone_void(this_ptr: *const c_void) -> *mut c_void {
        Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeOutPoint)).clone() })) as *mut c_void
 }
+#[no_mangle]
+pub extern "C" fn OutPoint_clone(orig: &OutPoint) -> OutPoint {
+       OutPoint { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+}
 /// The referenced transaction's txid.
 #[no_mangle]
 pub extern "C" fn OutPoint_get_txid(this_ptr: &OutPoint) -> *const [u8; 32] {