Regenerate with ChannelMonitor (and more) clone patch 2021-03-java-bindings-base
authorMatt Corallo <git@bluematt.me>
Sat, 1 May 2021 00:06:18 +0000 (00:06 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 11 Jun 2021 17:12:15 +0000 (17:12 +0000)
lightning-c-bindings/Cargo.toml
lightning-c-bindings/include/lightning.h
lightning-c-bindings/src/lightning/chain/channelmonitor.rs

index d06861d6ff7fccca6ec307cc8a04e38dab49b61c..394902a59ee752e497a0fa53f369df2a275f297b 100644 (file)
@@ -18,10 +18,10 @@ crate-type = ["staticlib"
 bitcoin = "0.26"
 secp256k1 = { version = "0.20.1", features = ["global-context-less-secure"] }
 # Note that the following line is matched by genbindings to update the path
-lightning = { git = "https://git.bitcoin.ninja/rust-lightning", rev = "a8038a8234b70bc261f633a9e2b40adebebcd8d4", features = ["allow_wallclock_use"] }
-lightning-persister = { git = "https://git.bitcoin.ninja/rust-lightning", rev = "a8038a8234b70bc261f633a9e2b40adebebcd8d4" }
-lightning-invoice = { git = "https://git.bitcoin.ninja/rust-lightning", rev = "a8038a8234b70bc261f633a9e2b40adebebcd8d4" }
-lightning-background-processor = { git = "https://git.bitcoin.ninja/rust-lightning", rev = "a8038a8234b70bc261f633a9e2b40adebebcd8d4" }
+lightning = { git = "https://git.bitcoin.ninja/rust-lightning", rev = "800dc06dbb39f6c421adb81e6ba3508ded3d7d74", features = ["allow_wallclock_use"] }
+lightning-persister = { git = "https://git.bitcoin.ninja/rust-lightning", rev = "800dc06dbb39f6c421adb81e6ba3508ded3d7d74" }
+lightning-invoice = { git = "https://git.bitcoin.ninja/rust-lightning", rev = "800dc06dbb39f6c421adb81e6ba3508ded3d7d74" }
+lightning-background-processor = { git = "https://git.bitcoin.ninja/rust-lightning", rev = "800dc06dbb39f6c421adb81e6ba3508ded3d7d74" }
 
 [patch.crates-io]
 # Rust-Secp256k1 upstream to get PR 279 until it is released.
index 8d27f343936b3071c1a28a4cce38d788ae88a072..1689dcd86a717fcaa8c729bd1f18500a7150323a 100644 (file)
@@ -12308,6 +12308,11 @@ struct LDKCResult_HTLCUpdateDecodeErrorZ HTLCUpdate_read(struct LDKu8slice ser);
  */
 void ChannelMonitor_free(struct LDKChannelMonitor this_obj);
 
+/**
+ * Creates a copy of the ChannelMonitor
+ */
+struct LDKChannelMonitor ChannelMonitor_clone(const struct LDKChannelMonitor *NONNULL_PTR orig);
+
 /**
  * Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
  */
index 1331506e033bbff55b2809c499c100488221aa48..dccc80d1af0b3cbd9f8ef4d130103d33ae047a8b 100644 (file)
@@ -544,6 +544,25 @@ impl ChannelMonitor {
                ret
        }
 }
+impl Clone for ChannelMonitor {
+       fn clone(&self) -> Self {
+               Self {
+                       inner: if <*mut nativeChannelMonitor>::is_null(self.inner) { std::ptr::null_mut() } else {
+                               Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
+                       is_owned: true,
+               }
+       }
+}
+#[allow(unused)]
+/// Used only if an object of this type is returned as a trait impl by a method
+pub(crate) extern "C" fn ChannelMonitor_clone_void(this_ptr: *const c_void) -> *mut c_void {
+       Box::into_raw(Box::new(unsafe { (*(this_ptr as *mut nativeChannelMonitor)).clone() })) as *mut c_void
+}
+#[no_mangle]
+/// Creates a copy of the ChannelMonitor
+pub extern "C" fn ChannelMonitor_clone(orig: &ChannelMonitor) -> ChannelMonitor {
+       orig.clone()
+}
 #[no_mangle]
 /// Serialize the ChannelMonitor object into a byte array which can be read by ChannelMonitor_read
 pub extern "C" fn ChannelMonitor_write(obj: &ChannelMonitor) -> crate::c_types::derived::CVec_u8Z {