Auto-generated bindings updates
[rust-lightning] / lightning-c-bindings / src / ln / msgs.rs
index 308730f53508a6af72c653557fe7b10470f1309c..416b532c103ba36a11e1ec0b7236fbc6766cfe19 100644 (file)
@@ -35,7 +35,7 @@ pub struct DecodeError {
 
 impl Drop for DecodeError {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeDecodeError>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -60,7 +60,7 @@ impl DecodeError {
 impl Clone for DecodeError {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeDecodeError>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -91,7 +91,7 @@ pub struct Init {
 
 impl Drop for Init {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeInit>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -113,10 +113,28 @@ impl Init {
                ret
        }
 }
+/// The relevant features which the sender supports
+#[no_mangle]
+pub extern "C" fn Init_get_features(this_ptr: &Init) -> crate::ln::features::InitFeatures {
+       let mut inner_val = &mut unsafe { &mut *this_ptr.inner }.features;
+       crate::ln::features::InitFeatures { inner: unsafe { ( (&((*inner_val)) as *const _) as *mut _) }, is_owned: false }
+}
+/// The relevant features which the sender supports
+#[no_mangle]
+pub extern "C" fn Init_set_features(this_ptr: &mut Init, mut val: crate::ln::features::InitFeatures) {
+       unsafe { &mut *this_ptr.inner }.features = *unsafe { Box::from_raw(val.take_inner()) };
+}
+#[must_use]
+#[no_mangle]
+pub extern "C" fn Init_new(mut features_arg: crate::ln::features::InitFeatures) -> Init {
+       Init { inner: Box::into_raw(Box::new(nativeInit {
+               features: *unsafe { Box::from_raw(features_arg.take_inner()) },
+       })), is_owned: true }
+}
 impl Clone for Init {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeInit>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -147,7 +165,7 @@ pub struct ErrorMessage {
 
 impl Drop for ErrorMessage {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeErrorMessage>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -208,7 +226,7 @@ pub extern "C" fn ErrorMessage_new(mut channel_id_arg: crate::c_types::ThirtyTwo
 impl Clone for ErrorMessage {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeErrorMessage>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -239,7 +257,7 @@ pub struct Ping {
 
 impl Drop for Ping {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativePing>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -296,7 +314,7 @@ pub extern "C" fn Ping_new(mut ponglen_arg: u16, mut byteslen_arg: u16) -> Ping
 impl Clone for Ping {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativePing>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -327,7 +345,7 @@ pub struct Pong {
 
 impl Drop for Pong {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativePong>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -372,7 +390,7 @@ pub extern "C" fn Pong_new(mut byteslen_arg: u16) -> Pong {
 impl Clone for Pong {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativePong>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -403,7 +421,7 @@ pub struct OpenChannel {
 
 impl Drop for OpenChannel {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeOpenChannel>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -626,7 +644,7 @@ pub extern "C" fn OpenChannel_set_channel_flags(this_ptr: &mut OpenChannel, mut
 impl Clone for OpenChannel {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeOpenChannel>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -657,7 +675,7 @@ pub struct AcceptChannel {
 
 impl Drop for AcceptChannel {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeAcceptChannel>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -836,7 +854,7 @@ pub extern "C" fn AcceptChannel_set_first_per_commitment_point(this_ptr: &mut Ac
 impl Clone for AcceptChannel {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeAcceptChannel>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -867,7 +885,7 @@ pub struct FundingCreated {
 
 impl Drop for FundingCreated {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeFundingCreated>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -946,7 +964,7 @@ pub extern "C" fn FundingCreated_new(mut temporary_channel_id_arg: crate::c_type
 impl Clone for FundingCreated {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeFundingCreated>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -977,7 +995,7 @@ pub struct FundingSigned {
 
 impl Drop for FundingSigned {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeFundingSigned>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -1032,7 +1050,7 @@ pub extern "C" fn FundingSigned_new(mut channel_id_arg: crate::c_types::ThirtyTw
 impl Clone for FundingSigned {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeFundingSigned>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -1063,7 +1081,7 @@ pub struct FundingLocked {
 
 impl Drop for FundingLocked {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeFundingLocked>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -1118,7 +1136,7 @@ pub extern "C" fn FundingLocked_new(mut channel_id_arg: crate::c_types::ThirtyTw
 impl Clone for FundingLocked {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeFundingLocked>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -1149,7 +1167,7 @@ pub struct Shutdown {
 
 impl Drop for Shutdown {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeShutdown>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -1206,7 +1224,7 @@ pub extern "C" fn Shutdown_new(mut channel_id_arg: crate::c_types::ThirtyTwoByte
 impl Clone for Shutdown {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeShutdown>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -1237,7 +1255,7 @@ pub struct ClosingSigned {
 
 impl Drop for ClosingSigned {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeClosingSigned>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -1304,7 +1322,7 @@ pub extern "C" fn ClosingSigned_new(mut channel_id_arg: crate::c_types::ThirtyTw
 impl Clone for ClosingSigned {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeClosingSigned>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -1335,7 +1353,7 @@ pub struct UpdateAddHTLC {
 
 impl Drop for UpdateAddHTLC {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeUpdateAddHTLC>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -1415,7 +1433,7 @@ pub extern "C" fn UpdateAddHTLC_set_cltv_expiry(this_ptr: &mut UpdateAddHTLC, mu
 impl Clone for UpdateAddHTLC {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeUpdateAddHTLC>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -1446,7 +1464,7 @@ pub struct UpdateFulfillHTLC {
 
 impl Drop for UpdateFulfillHTLC {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeUpdateFulfillHTLC>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -1513,7 +1531,7 @@ pub extern "C" fn UpdateFulfillHTLC_new(mut channel_id_arg: crate::c_types::Thir
 impl Clone for UpdateFulfillHTLC {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeUpdateFulfillHTLC>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -1544,7 +1562,7 @@ pub struct UpdateFailHTLC {
 
 impl Drop for UpdateFailHTLC {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeUpdateFailHTLC>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -1591,7 +1609,7 @@ pub extern "C" fn UpdateFailHTLC_set_htlc_id(this_ptr: &mut UpdateFailHTLC, mut
 impl Clone for UpdateFailHTLC {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeUpdateFailHTLC>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -1622,7 +1640,7 @@ pub struct UpdateFailMalformedHTLC {
 
 impl Drop for UpdateFailMalformedHTLC {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeUpdateFailMalformedHTLC>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -1680,7 +1698,7 @@ pub extern "C" fn UpdateFailMalformedHTLC_set_failure_code(this_ptr: &mut Update
 impl Clone for UpdateFailMalformedHTLC {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeUpdateFailMalformedHTLC>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -1711,7 +1729,7 @@ pub struct CommitmentSigned {
 
 impl Drop for CommitmentSigned {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeCommitmentSigned>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -1774,7 +1792,7 @@ pub extern "C" fn CommitmentSigned_new(mut channel_id_arg: crate::c_types::Thirt
 impl Clone for CommitmentSigned {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeCommitmentSigned>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -1805,7 +1823,7 @@ pub struct RevokeAndACK {
 
 impl Drop for RevokeAndACK {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeRevokeAndACK>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -1872,7 +1890,7 @@ pub extern "C" fn RevokeAndACK_new(mut channel_id_arg: crate::c_types::ThirtyTwo
 impl Clone for RevokeAndACK {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeRevokeAndACK>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -1903,7 +1921,7 @@ pub struct UpdateFee {
 
 impl Drop for UpdateFee {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeUpdateFee>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -1958,7 +1976,7 @@ pub extern "C" fn UpdateFee_new(mut channel_id_arg: crate::c_types::ThirtyTwoByt
 impl Clone for UpdateFee {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeUpdateFee>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -1992,7 +2010,7 @@ pub struct DataLossProtect {
 
 impl Drop for DataLossProtect {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeDataLossProtect>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -2049,7 +2067,7 @@ pub extern "C" fn DataLossProtect_new(mut your_last_per_commitment_secret_arg: c
 impl Clone for DataLossProtect {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeDataLossProtect>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -2080,7 +2098,7 @@ pub struct ChannelReestablish {
 
 impl Drop for ChannelReestablish {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeChannelReestablish>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -2138,7 +2156,7 @@ pub extern "C" fn ChannelReestablish_set_next_remote_commitment_number(this_ptr:
 impl Clone for ChannelReestablish {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeChannelReestablish>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -2169,7 +2187,7 @@ pub struct AnnouncementSignatures {
 
 impl Drop for AnnouncementSignatures {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeAnnouncementSignatures>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -2248,7 +2266,7 @@ pub extern "C" fn AnnouncementSignatures_new(mut channel_id_arg: crate::c_types:
 impl Clone for AnnouncementSignatures {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeAnnouncementSignatures>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -2472,7 +2490,7 @@ pub struct UnsignedNodeAnnouncement {
 
 impl Drop for UnsignedNodeAnnouncement {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeUnsignedNodeAnnouncement>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -2562,7 +2580,7 @@ pub extern "C" fn UnsignedNodeAnnouncement_set_addresses(this_ptr: &mut Unsigned
 impl Clone for UnsignedNodeAnnouncement {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeUnsignedNodeAnnouncement>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -2593,7 +2611,7 @@ pub struct NodeAnnouncement {
 
 impl Drop for NodeAnnouncement {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeNodeAnnouncement>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -2648,7 +2666,7 @@ pub extern "C" fn NodeAnnouncement_new(mut signature_arg: crate::c_types::Signat
 impl Clone for NodeAnnouncement {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeNodeAnnouncement>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -2679,7 +2697,7 @@ pub struct UnsignedChannelAnnouncement {
 
 impl Drop for UnsignedChannelAnnouncement {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeUnsignedChannelAnnouncement>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -2781,7 +2799,7 @@ pub extern "C" fn UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr: &mut U
 impl Clone for UnsignedChannelAnnouncement {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeUnsignedChannelAnnouncement>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -2812,7 +2830,7 @@ pub struct ChannelAnnouncement {
 
 impl Drop for ChannelAnnouncement {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeChannelAnnouncement>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -2903,7 +2921,7 @@ pub extern "C" fn ChannelAnnouncement_new(mut node_signature_1_arg: crate::c_typ
 impl Clone for ChannelAnnouncement {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeChannelAnnouncement>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -2934,7 +2952,7 @@ pub struct UnsignedChannelUpdate {
 
 impl Drop for UnsignedChannelUpdate {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeUnsignedChannelUpdate>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -3047,7 +3065,7 @@ pub extern "C" fn UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr
 impl Clone for UnsignedChannelUpdate {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeUnsignedChannelUpdate>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -3078,7 +3096,7 @@ pub struct ChannelUpdate {
 
 impl Drop for ChannelUpdate {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeChannelUpdate>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -3133,7 +3151,7 @@ pub extern "C" fn ChannelUpdate_new(mut signature_arg: crate::c_types::Signature
 impl Clone for ChannelUpdate {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeChannelUpdate>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -3167,7 +3185,7 @@ pub struct QueryChannelRange {
 
 impl Drop for QueryChannelRange {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeQueryChannelRange>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -3234,7 +3252,7 @@ pub extern "C" fn QueryChannelRange_new(mut chain_hash_arg: crate::c_types::Thir
 impl Clone for QueryChannelRange {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeQueryChannelRange>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -3271,7 +3289,7 @@ pub struct ReplyChannelRange {
 
 impl Drop for ReplyChannelRange {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeReplyChannelRange>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -3358,7 +3376,7 @@ pub extern "C" fn ReplyChannelRange_new(mut chain_hash_arg: crate::c_types::Thir
 impl Clone for ReplyChannelRange {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeReplyChannelRange>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -3396,7 +3414,7 @@ pub struct QueryShortChannelIds {
 
 impl Drop for QueryShortChannelIds {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeQueryShortChannelIds>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -3447,7 +3465,7 @@ pub extern "C" fn QueryShortChannelIds_new(mut chain_hash_arg: crate::c_types::T
 impl Clone for QueryShortChannelIds {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeQueryShortChannelIds>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -3481,7 +3499,7 @@ pub struct ReplyShortChannelIdsEnd {
 
 impl Drop for ReplyShortChannelIdsEnd {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeReplyShortChannelIdsEnd>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -3538,7 +3556,7 @@ pub extern "C" fn ReplyShortChannelIdsEnd_new(mut chain_hash_arg: crate::c_types
 impl Clone for ReplyShortChannelIdsEnd {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeReplyShortChannelIdsEnd>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -3571,7 +3589,7 @@ pub struct GossipTimestampFilter {
 
 impl Drop for GossipTimestampFilter {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeGossipTimestampFilter>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -3638,7 +3656,7 @@ pub extern "C" fn GossipTimestampFilter_new(mut chain_hash_arg: crate::c_types::
 impl Clone for GossipTimestampFilter {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeGossipTimestampFilter>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -3766,7 +3784,7 @@ pub struct LightningError {
 
 impl Drop for LightningError {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeLightningError>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -3821,7 +3839,7 @@ pub extern "C" fn LightningError_new(mut err_arg: crate::c_types::derived::CVec_
 impl Clone for LightningError {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeLightningError>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -3853,7 +3871,7 @@ pub struct CommitmentUpdate {
 
 impl Drop for CommitmentUpdate {
        fn drop(&mut self) {
-               if self.is_owned && !self.inner.is_null() {
+               if self.is_owned && !<*mut nativeCommitmentUpdate>::is_null(self.inner) {
                        let _ = unsafe { Box::from_raw(self.inner) };
                }
        }
@@ -3943,7 +3961,7 @@ pub extern "C" fn CommitmentUpdate_new(mut update_add_htlcs_arg: crate::c_types:
 impl Clone for CommitmentUpdate {
        fn clone(&self) -> Self {
                Self {
-                       inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+                       inner: if <*mut nativeCommitmentUpdate>::is_null(self.inner) { std::ptr::null_mut() } else {
                                Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
                        is_owned: true,
                }
@@ -4105,7 +4123,7 @@ pub struct ChannelMessageHandler {
        /// Handle an incoming funding_locked message from the given peer.
        pub handle_funding_locked: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::FundingLocked),
        /// Handle an incoming shutdown message from the given peer.
-       pub handle_shutdown: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::Shutdown),
+       pub handle_shutdown: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, their_features: &crate::ln::features::InitFeatures, msg: &crate::ln::msgs::Shutdown),
        /// Handle an incoming closing_signed message from the given peer.
        pub handle_closing_signed: extern "C" fn (this_arg: *const c_void, their_node_id: crate::c_types::PublicKey, msg: &crate::ln::msgs::ClosingSigned),
        /// Handle an incoming update_add_htlc message from the given peer.
@@ -4163,8 +4181,8 @@ impl rustChannelMessageHandler for ChannelMessageHandler {
        fn handle_funding_locked(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::FundingLocked) {
                (self.handle_funding_locked)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::ln::msgs::FundingLocked { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
        }
-       fn handle_shutdown(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::Shutdown) {
-               (self.handle_shutdown)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::ln::msgs::Shutdown { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
+       fn handle_shutdown(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, their_features: &lightning::ln::features::InitFeatures, msg: &lightning::ln::msgs::Shutdown) {
+               (self.handle_shutdown)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::ln::features::InitFeatures { inner: unsafe { (their_features as *const _) as *mut _ }, is_owned: false }, &crate::ln::msgs::Shutdown { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })
        }
        fn handle_closing_signed(&self, their_node_id: &bitcoin::secp256k1::key::PublicKey, msg: &lightning::ln::msgs::ClosingSigned) {
                (self.handle_closing_signed)(self.this_arg, crate::c_types::PublicKey::from_rust(&their_node_id), &crate::ln::msgs::ClosingSigned { inner: unsafe { (msg as *const _) as *mut _ }, is_owned: false })