/// now + 5*time_forwardable).
time_forwardable: u64,
},
- /// Used to indicate that an output was generated on-chain which you should know how to spend.
+ /// Used to indicate that an output which you should know how to spend was confirmed on chain
+ /// and is now spendable.
/// Such an output will *not* ever be spent by rust-lightning, and are not at risk of your
/// counterparty spending them due to some kind of timeout. Thus, you need to store them
/// somewhere and spend them when you create on-chain transactions.
/// The channel_update which should be sent.
msg: crate::lightning::ln::msgs::ChannelUpdate,
},
+ /// Used to indicate that a channel_update should be sent to a single peer.
+ /// In contrast to [`Self::BroadcastChannelUpdate`], this is used when the channel is a
+ /// private channel and we shouldn't be informing all of our peers of channel parameters.
+ SendChannelUpdate {
+ /// The node_id of the node which should receive this message
+ node_id: crate::c_types::PublicKey,
+ /// The channel_update which should be sent.
+ msg: crate::lightning::ln::msgs::ChannelUpdate,
+ },
/// Broadcast an error downstream to be handled
HandleError {
/// The node_id of the node which should receive this message
msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
+ MessageSendEvent::SendChannelUpdate {ref node_id, ref msg, } => {
+ let mut node_id_nonref = (*node_id).clone();
+ let mut msg_nonref = (*msg).clone();
+ nativeMessageSendEvent::SendChannelUpdate {
+ node_id: node_id_nonref.into_rust(),
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
+ }
+ },
MessageSendEvent::HandleError {ref node_id, ref action, } => {
let mut node_id_nonref = (*node_id).clone();
let mut action_nonref = (*action).clone();
msg: *unsafe { Box::from_raw(msg.take_inner()) },
}
},
+ MessageSendEvent::SendChannelUpdate {mut node_id, mut msg, } => {
+ nativeMessageSendEvent::SendChannelUpdate {
+ node_id: node_id.into_rust(),
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
+ }
+ },
MessageSendEvent::HandleError {mut node_id, mut action, } => {
nativeMessageSendEvent::HandleError {
node_id: node_id.into_rust(),
msg: crate::lightning::ln::msgs::ChannelUpdate { inner: Box::into_raw(Box::new(msg_nonref)), is_owned: true },
}
},
+ nativeMessageSendEvent::SendChannelUpdate {ref node_id, ref msg, } => {
+ let mut node_id_nonref = (*node_id).clone();
+ let mut msg_nonref = (*msg).clone();
+ MessageSendEvent::SendChannelUpdate {
+ node_id: crate::c_types::PublicKey::from_rust(&node_id_nonref),
+ msg: crate::lightning::ln::msgs::ChannelUpdate { inner: Box::into_raw(Box::new(msg_nonref)), is_owned: true },
+ }
+ },
nativeMessageSendEvent::HandleError {ref node_id, ref action, } => {
let mut node_id_nonref = (*node_id).clone();
let mut action_nonref = (*action).clone();
msg: crate::lightning::ln::msgs::ChannelUpdate { inner: Box::into_raw(Box::new(msg)), is_owned: true },
}
},
+ nativeMessageSendEvent::SendChannelUpdate {mut node_id, mut msg, } => {
+ MessageSendEvent::SendChannelUpdate {
+ node_id: crate::c_types::PublicKey::from_rust(&node_id),
+ msg: crate::lightning::ln::msgs::ChannelUpdate { inner: Box::into_raw(Box::new(msg)), is_owned: true },
+ }
+ },
nativeMessageSendEvent::HandleError {mut node_id, mut action, } => {
MessageSendEvent::HandleError {
node_id: crate::c_types::PublicKey::from_rust(&node_id),
/// 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<extern "C" fn(this_arg: *mut c_void)>,
}
+unsafe impl Send for MessageSendEventsProvider {}
+unsafe impl Sync for MessageSendEventsProvider {}
use lightning::util::events::MessageSendEventsProvider as rustMessageSendEventsProvider;
impl rustMessageSendEventsProvider for MessageSendEventsProvider {
/// 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<extern "C" fn(this_arg: *mut c_void)>,
}
+unsafe impl Send for EventsProvider {}
+unsafe impl Sync for EventsProvider {}
use lightning::util::events::EventsProvider as rustEventsProvider;
/// Calls the free function if one is set
/// 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<extern "C" fn(this_arg: *mut c_void)>,
}
+unsafe impl Send for EventHandler {}
+unsafe impl Sync for EventHandler {}
use lightning::util::events::EventHandler as rustEventHandler;
impl rustEventHandler for EventHandler {