+// 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.
+
//! Events are returned from various bits in the library which indicate some action must be taken
//! by the client.
//!
/// The value passed in to ChannelManager::create_channel
user_channel_id: u64,
},
- /// Used to indicate that the client may now broadcast the funding transaction it created for a
- /// channel. Broadcasting such a transaction prior to this event may lead to our counterparty
- /// trivially stealing all funds in the funding transaction!
- FundingBroadcastSafe {
- /// The output, which was passed to ChannelManager::funding_transaction_generated, which is
- /// now safe to broadcast.
- funding_txo: crate::chain::transaction::OutPoint,
- /// The value passed in to ChannelManager::create_channel
- user_channel_id: u64,
- },
/// Indicates we've received money! Just gotta dig out that payment preimage and feed it to
/// ChannelManager::claim_funds to get it....
/// Note that if the preimage is not known or the amount paid is incorrect, you should call
user_channel_id: user_channel_id_nonref,
}
},
- Event::FundingBroadcastSafe {ref funding_txo, ref user_channel_id, } => {
- let mut funding_txo_nonref = (*funding_txo).clone();
- let mut user_channel_id_nonref = (*user_channel_id).clone();
- nativeEvent::FundingBroadcastSafe {
- funding_txo: *unsafe { Box::from_raw(funding_txo_nonref.take_inner()) },
- user_channel_id: user_channel_id_nonref,
- }
- },
Event::PaymentReceived {ref payment_hash, ref payment_secret, ref amt, } => {
let mut payment_hash_nonref = (*payment_hash).clone();
let mut payment_secret_nonref = (*payment_secret).clone();
user_channel_id: user_channel_id,
}
},
- Event::FundingBroadcastSafe {mut funding_txo, mut user_channel_id, } => {
- nativeEvent::FundingBroadcastSafe {
- funding_txo: *unsafe { Box::from_raw(funding_txo.take_inner()) },
- user_channel_id: user_channel_id,
- }
- },
Event::PaymentReceived {mut payment_hash, mut payment_secret, mut amt, } => {
let mut local_payment_secret = if payment_secret.data == [0; 32] { None } else { Some( { ::lightning::ln::channelmanager::PaymentSecret(payment_secret.data) }) };
nativeEvent::PaymentReceived {
user_channel_id: user_channel_id_nonref,
}
},
- nativeEvent::FundingBroadcastSafe {ref funding_txo, ref user_channel_id, } => {
- let mut funding_txo_nonref = (*funding_txo).clone();
- let mut user_channel_id_nonref = (*user_channel_id).clone();
- Event::FundingBroadcastSafe {
- funding_txo: crate::chain::transaction::OutPoint { inner: Box::into_raw(Box::new(funding_txo_nonref)), is_owned: true },
- user_channel_id: user_channel_id_nonref,
- }
- },
nativeEvent::PaymentReceived {ref payment_hash, ref payment_secret, ref amt, } => {
let mut payment_hash_nonref = (*payment_hash).clone();
let mut payment_secret_nonref = (*payment_secret).clone();
user_channel_id: user_channel_id,
}
},
- nativeEvent::FundingBroadcastSafe {mut funding_txo, mut user_channel_id, } => {
- Event::FundingBroadcastSafe {
- funding_txo: crate::chain::transaction::OutPoint { inner: Box::into_raw(Box::new(funding_txo)), is_owned: true },
- user_channel_id: user_channel_id,
- }
- },
nativeEvent::PaymentReceived {mut payment_hash, mut payment_secret, mut amt, } => {
let mut local_payment_secret = if payment_secret.is_none() { crate::c_types::ThirtyTwoBytes::null() } else { { crate::c_types::ThirtyTwoBytes { data: (payment_secret.unwrap()).0 } } };
Event::PaymentReceived {
/// The query_short_channel_ids which should be sent.
msg: crate::ln::msgs::QueryShortChannelIds,
},
+ /// Sends a reply to a channel range query. This may be one of several SendReplyChannelRange events
+ /// emitted during processing of the query.
+ SendReplyChannelRange {
+ /// The node_id of this message recipient
+ node_id: crate::c_types::PublicKey,
+ /// The reply_channel_range which should be sent.
+ msg: crate::ln::msgs::ReplyChannelRange,
+ },
}
use lightning::util::events::MessageSendEvent as nativeMessageSendEvent;
impl MessageSendEvent {
msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
}
},
+ MessageSendEvent::SendReplyChannelRange {ref node_id, ref msg, } => {
+ let mut node_id_nonref = (*node_id).clone();
+ let mut msg_nonref = (*msg).clone();
+ nativeMessageSendEvent::SendReplyChannelRange {
+ node_id: node_id_nonref.into_rust(),
+ msg: *unsafe { Box::from_raw(msg_nonref.take_inner()) },
+ }
+ },
}
}
#[allow(unused)]
msg: *unsafe { Box::from_raw(msg.take_inner()) },
}
},
+ MessageSendEvent::SendReplyChannelRange {mut node_id, mut msg, } => {
+ nativeMessageSendEvent::SendReplyChannelRange {
+ node_id: node_id.into_rust(),
+ msg: *unsafe { Box::from_raw(msg.take_inner()) },
+ }
+ },
}
}
#[allow(unused)]
msg: crate::ln::msgs::QueryShortChannelIds { inner: Box::into_raw(Box::new(msg_nonref)), is_owned: true },
}
},
+ nativeMessageSendEvent::SendReplyChannelRange {ref node_id, ref msg, } => {
+ let mut node_id_nonref = (*node_id).clone();
+ let mut msg_nonref = (*msg).clone();
+ MessageSendEvent::SendReplyChannelRange {
+ node_id: crate::c_types::PublicKey::from_rust(&node_id_nonref),
+ msg: crate::ln::msgs::ReplyChannelRange { inner: Box::into_raw(Box::new(msg_nonref)), is_owned: true },
+ }
+ },
}
}
#[allow(unused)]
msg: crate::ln::msgs::QueryShortChannelIds { inner: Box::into_raw(Box::new(msg)), is_owned: true },
}
},
+ nativeMessageSendEvent::SendReplyChannelRange {mut node_id, mut msg, } => {
+ MessageSendEvent::SendReplyChannelRange {
+ node_id: crate::c_types::PublicKey::from_rust(&node_id),
+ msg: crate::ln::msgs::ReplyChannelRange { inner: Box::into_raw(Box::new(msg)), is_owned: true },
+ }
+ },
}
}
}