}
/// An open_channel message to be sent or received from a peer
+#[derive(Clone)]
pub struct OpenChannel {
pub(crate) chain_hash: Sha256dHash,
pub(crate) temporary_channel_id: [u8; 32],
}
/// An accept_channel message to be sent or received from a peer
+#[derive(Clone)]
pub struct AcceptChannel {
pub(crate) temporary_channel_id: [u8; 32],
pub(crate) dust_limit_satoshis: u64,
}
/// A funding_created message to be sent or received from a peer
+#[derive(Clone)]
pub struct FundingCreated {
pub(crate) temporary_channel_id: [u8; 32],
pub(crate) funding_txid: Sha256dHash,
}
/// A funding_signed message to be sent or received from a peer
+#[derive(Clone)]
pub struct FundingSigned {
pub(crate) channel_id: [u8; 32],
pub(crate) signature: Signature,
pub trait ChannelMessageHandler : events::MessageSendEventsProvider + Send + Sync {
//Channel init:
/// Handle an incoming open_channel message from the given peer.
- fn handle_open_channel(&self, their_node_id: &PublicKey, msg: &OpenChannel) -> Result<AcceptChannel, HandleError>;
+ fn handle_open_channel(&self, their_node_id: &PublicKey, msg: &OpenChannel) -> Result<(), HandleError>;
/// Handle an incoming accept_channel message from the given peer.
fn handle_accept_channel(&self, their_node_id: &PublicKey, msg: &AcceptChannel) -> Result<(), HandleError>;
/// Handle an incoming funding_created message from the given peer.
- fn handle_funding_created(&self, their_node_id: &PublicKey, msg: &FundingCreated) -> Result<FundingSigned, HandleError>;
+ fn handle_funding_created(&self, their_node_id: &PublicKey, msg: &FundingCreated) -> Result<(), HandleError>;
/// Handle an incoming funding_signed message from the given peer.
fn handle_funding_signed(&self, their_node_id: &PublicKey, msg: &FundingSigned) -> Result<(), HandleError>;
/// Handle an incoming funding_locked message from the given peer.
- fn handle_funding_locked(&self, their_node_id: &PublicKey, msg: &FundingLocked) -> Result<Option<AnnouncementSignatures>, HandleError>;
+ fn handle_funding_locked(&self, their_node_id: &PublicKey, msg: &FundingLocked) -> Result<(), HandleError>;
// Channl close:
/// Handle an incoming shutdown message from the given peer.