}
/// An error message to be sent or received from a peer
+#[derive(Clone)]
pub struct ErrorMessage {
pub(crate) channel_id: [u8; 32],
pub(crate) data: String,
}
/// A shutdown message to be sent or received from a peer
-#[derive(Clone)]
+#[derive(Clone, PartialEq)]
pub struct Shutdown {
pub(crate) channel_id: [u8; 32],
pub(crate) scriptpubkey: Script,
}
/// A closing_signed message to be sent or received from a peer
-#[derive(Clone)]
+#[derive(Clone, PartialEq)]
pub struct ClosingSigned {
pub(crate) channel_id: [u8; 32],
pub(crate) fee_satoshis: u64,
pub(crate) feerate_per_kw: u32,
}
-#[derive(PartialEq)]
+#[derive(PartialEq, Clone)]
pub(crate) struct DataLossProtect {
pub(crate) your_last_per_commitment_secret: [u8; 32],
pub(crate) my_current_per_commitment_point: PublicKey,
}
/// A channel_reestablish message to be sent or received from a peer
-#[derive(PartialEq)]
+#[derive(PartialEq, Clone)]
pub struct ChannelReestablish {
pub(crate) channel_id: [u8; 32],
pub(crate) next_local_commitment_number: u64,
}
}
+#[derive(Clone)]
// Only exposed as broadcast of node_announcement should be filtered by node_id
/// The unsigned part of a node_announcement
pub struct UnsignedNodeAnnouncement {
pub(crate) excess_address_data: Vec<u8>,
pub(crate) excess_data: Vec<u8>,
}
+#[derive(Clone)]
/// A node_announcement message to be sent or received from a peer
pub struct NodeAnnouncement {
pub(crate) signature: Signature,
}
/// Used to put an error message in a HandleError
+#[derive(Clone)]
pub enum ErrorAction {
/// The peer took some action which made us think they were useless. Disconnect them.
DisconnectPeer {
/// The information we received from a peer along the route of a payment we originated. This is
/// returned by ChannelMessageHandler::handle_update_fail_htlc to be passed into
/// RoutingMessageHandler::handle_htlc_fail_channel_update to update our network map.
+#[derive(Clone)]
pub enum HTLCFailChannelUpdate {
/// We received an error which included a full ChannelUpdate message.
ChannelUpdateMessage {
fn peer_disconnected(&self, their_node_id: &PublicKey, no_connection_possible: bool);
/// Handle a peer reconnecting, possibly generating channel_reestablish message(s).
- fn peer_connected(&self, their_node_id: &PublicKey) -> Vec<ChannelReestablish>;
+ fn peer_connected(&self, their_node_id: &PublicKey);
/// Handle an incoming channel_reestablish message from the given peer.
fn handle_channel_reestablish(&self, their_node_id: &PublicKey, msg: &ChannelReestablish) -> Result<(), HandleError>;
fn handle_channel_update(&self, msg: &ChannelUpdate) -> Result<bool, HandleError>;
/// Handle some updates to the route graph that we learned due to an outbound failed payment.
fn handle_htlc_fail_channel_update(&self, update: &HTLCFailChannelUpdate);
+ /// Gets a subset of the channel announcements and updates required to dump our routing table
+ /// to a remote node, starting at the short_channel_id indicated by starting_point and
+ /// including batch_amount entries.
+ fn get_next_channel_announcements(&self, starting_point: u64, batch_amount: u8) -> Vec<(ChannelAnnouncement, ChannelUpdate, ChannelUpdate)>;
+ /// Gets a subset of the node announcements required to dump our routing table to a remote node,
+ /// starting at the node *after* the provided publickey and including batch_amount entries.
+ /// If None is provided for starting_point, we start at the first node.
+ fn get_next_node_announcements(&self, starting_point: Option<&PublicKey>, batch_amount: u8) -> Vec<NodeAnnouncement>;
}
pub(crate) struct OnionRealm0HopData {